Modulo:mlawc

El Vikivortaro
Salti al navigilo Salti al serĉilo

Dokumentado por ĉi tiu modulo povas esti kreata ĉe Modulo:mlawc/dokumentado

--[===[

MODULE "MLAWC" (language and word class)

"eo.wiktionary.org/wiki/Modulo:mlawc" <!--2019-May-12-->
"id.wiktionary.org/wiki/Modul:mlawc"

Purpose: shows the lemma in bold text and brews 2 tooltip hints and
         3 category links from language code and word class code,
         optionally splits a multiword lemma into links to the parts

Utilo: montras kapvorton en grasa tiparfasono kaj generas 2 musumkonsilojn kaj
       3 kategoriajn ligilojn el lingva kodo kaj vortospeca kodo,
       opcie disigas plurvortan kapvorton al ligiloj al la partoj

Manfaat: memperlihatkan lema dengan teks tebal dan membuat 2 tooltip dan
         3 pranala kategori dari kode bahasa dan kode kelas kata,
         juga bisa membagi lema beberapa kata menjadi pranala ke bagiannya

Used by templates / Uzata far sxablonoj / Digunakan oleh templat:
- livs (EO) , bakk (ID)

Required submodules / Bezonataj submoduloj / Submodul yang diperlukan:
- "mpiktbllki" in turn requiring "mtmplloaddata" in turn requiring
  template "tbllingvoj" (EO) or "tblbahasa" (ID)

Incoming: - nothing (seized from caller's frame instead)

Returned: - one string intended to be showed alone in a line below
            h3-heading, consisting of the word in bold and enclosed in
            <bdi>...</bdi>, space, and a short summary (example:
            "( sv , VE )" with 2 tooltips (example:
            "Bahasa: Swedia (Svenska)" and "Kelas kata: verba (kata kerja)")

Parameters seized from the caller's frame:
          - 2 anonymous obligatory parameters
            - language code (2 or 3 lowercase letters, use "??" if unknown)
            - word class code (2 UPPERCASE letters, use "??" if unknown)
          - 1 anonymous optional parameter
            - word with division links (example: "[[per-|per]][[alat]]
              [[-an|an]]"), if not specified then pagename is used, if
              the pagename is a multiword lemma then it is split into
              links to the parts, specify this parameter if a different
              or no split is desired, more than 2 subsequent
              apo:s <<''>> prohibited

This module is unbreakable (when called with correct module name
and function name). Every imaginable input from the caller and
from the imported module "mtmplloaddata" will output either a useful
result or at least an error string.

Cxi tiu modulo estas nerompebla (kiam vokita kun gxustaj nomo de modulo
kaj nomo de funkcio). Cxiu imagebla enigo de la vokanto kaj
de la importata modulo "mtmplloaddata" eldonos aux utilan
rezulton aux almenaux eraranoncan signocxenon.

The 20 word classes are:
- SB noun                  - substantivo (O-vorto)           - nomina (kata benda)
- VE verb                  - verbo (I-vorto)                 - verba (kata kerja)
- AJ adjective             - adjektivo (A-vorto)             - adjektiva (kata sifat)
- PN pronoun               - pronomo                         - pronomina (kata pengganti)
- NV numeral               - numeralo (nombrovorto)          - numeralia (kata bilangan)
- AV adverb                - adverbo (E-vorto)               - adverbia (kata keterangan)
- PV verb particle (EN,SV) - verbpartiklo                    - partikel verba
- QV question word         - demandvorto                     - kata tanya
- KJ coordinator           - konjunkcio                      - konjungsi
- SJ subordinator          - subjunkcio (subfrazenkondukilo) - subjungsi (pemberitahu klausa terikat)
- PP preposition           - prepozicio                      - preposisi (kata depan)
- PO postposition (EN,SV)  - postpozicio                     - postposisi (kata belakang)
- PC circumposition (SV)   - cirkumpozicio                   - sirkumposisi
- AR article (EN,EO,SV)    - artikolo                        - artikel (kata sandang)
- IN interjection          - interjekcio                     - interjeksi
- PF prefix                - prefikso                        - prefiks (awalan)
- UF suffix                - sufikso                         - sufiks (akhiran)
- KF circumfix             - cirkumfikso                     - sirkumfiks (konfiks)
- IF infix                 - infikso                         - infiks (sisipan)
- KA sentence              - frazo                           - kalimat

We do NOT care about the "base word" property, it is
categorized by module "tagg" instead.

EO:

Kategorio:Angla                              Kategorio:Esperanto
Kategorio:Verbo
Kategorio:Verbo (angla)                      Kategorio:Verbo (Esperanto)

Note: "angla" is lowercase when in brackets, but begins uppercase when
       separate (pagename in category namespace), we auto-adjust
       the letter case

ID:

Kategori:Kata bahasa Indonesia
Kategori:Nomina
Kategori:id:Nomina

Note: we auto-remove the part of word class in brackets and auto-adjust the
      letter case, thus "nomina (kata benda)" becomes "Nomina"

There are some difficulties with the tooltip to be diplayed via the "title="
attribute. HTML tags cannot be nested, thus neither <br> nor <bdi>...</bdi>
can be used. We have no solution to <br> (apart from splitting the tooltip
into 2 fragments), and for <bdi>...</bdi> se use the unicode explicit isolator
"FIRST STRONG ISOLATE (FSI)" which does have the expected effect but may
as a side effect show as a rectangle in some browsers. Alternatively, an
advanced tooltip can be achieved using CSS and the "hover" selector but this
is not accessible from inside wikitext. Even an extension for such advanced
tooltips exists but is not enabled on most public wikies.

]===]

local lawc = {}

---- CONSTANTS ----

  -- surrogate transcoding table (only needed for EO)

  local contabtransiltable = {}
  contabtransiltable[ 67] = 0xC488 -- CX
  contabtransiltable[ 99] = 0xC489 -- cx
  contabtransiltable[ 71] = 0xC49C -- GX
  contabtransiltable[103] = 0xC49D -- gx
  contabtransiltable[ 74] = 0xC4B4 -- JX
  contabtransiltable[106] = 0xC4B5 -- jx
  contabtransiltable[ 83] = 0xC59C -- SX
  contabtransiltable[115] = 0xC59D -- sx
  contabtransiltable[ 85] = 0xC5AC -- UX breve
  contabtransiltable[117] = 0xC5AD -- ux breve

  -- constant strings (generic & misc)

  local constrkros  = '&nbsp;#&nbsp;#&nbsp;'
  local constrelabg = '<span class="error"><b>'                         -- lagom whining begin
  local constrelaen = '</b></span>'                                     -- lagom whining end
  local constrehubg = constrkros .. constrelabg                         -- huge whining begin
  local constrehuen = constrelaen .. constrkros                         -- huge whining end
  local constrtoolt = 'style="border-bottom:1px dotted; cursor:help;"'  -- lousy tooltip
  local constrisobg = '(&#8296; '  -- isolator for "strange" (RTL, submicroscopic) text begin
  local constrisoen = ' &#8296;)'  -- isolator for "strange" (RTL, submicroscopic) text end

  -- constant strings EO vs ID (depends from above "generic & misc" section)

  local constrpriv = "eo"                 -- EO (privileged site language)
  -- local constrpriv = "id"                 -- ID (privileged site language)
  local constrplki = "Modulo:mpiktbllki"  -- EO
  -- local constrplki = "Modul:mpiktbllki"   -- ID

  local constrbadu = constrehubg .. 'Erara uzo de sxablono "livs", legu gxian dokumentajxon' .. constrehuen    -- EO
  -- local constrbadu = constrehubg .. 'Penggunaan salah templat "bakk", bacalah dokumentasinya' .. constrehuen   -- ID
  local constrsubp = constrehubg .. 'Eraro en subsxablonoj uzataj far sxablono "livs"' .. constrehuen          -- EO
  -- local constrsubp = constrehubg .. 'Kesalahan dalam subtemplat digunakan oleh templat "bakk"' .. constrehuen  -- ID

  local constrkatp = "Kategorio:"  -- EO
  -- local constrkatp = "Kategori:"   -- ID

  local constrneli = "nekonata lingvo"            -- EO
  -- local constrneli = "bahasa yang tidak dikenal"  -- ID

  local constrnekk = "nekonata vortospeco"            -- EO
  -- local constrnekk = "kelas kata yang tidak dikenal"  -- ID

  local constrbaha = "Lingvo: "      -- EO
  -- local constrbaha = "Bahasa: "      -- ID
  local constrkeka = "Vortospeco: "  -- EO
  -- local constrkeka = "Kelas kata: "  -- ID

  local contabwc = {}
  contabwc["SB"] = "substantivo (O-vorto)"            -- EO
  -- contabwc["SB"] = "nomina (kata benda)"              -- ID
  contabwc["VE"] = "verbo (I-vorto)"                  -- EO
  -- contabwc["VE"] = "verba (kata kerja)"               -- ID
  contabwc["AJ"] = "adjektivo (A-vorto)"              -- EO
  -- contabwc["AJ"] = "adjektiva (kata sifat)"           -- ID
  contabwc["PN"] = "pronomo"                          -- EO
  -- contabwc["PN"] = "pronomina (kata pengganti)"       -- ID
  contabwc["NV"] = "numeralo (nombrovorto)"           -- EO
  -- contabwc["NV"] = "numeralia (kata bilangan)"        -- ID
  contabwc["AV"] = "adverbo (E-vorto)"                -- EO
  -- contabwc["AV"] = "adverbia (kata keterangan)"       -- ID
  contabwc["PV"] = "verbpartiklo"                     -- EO
  -- contabwc["PV"] = "partikel verba"                   -- ID
  contabwc["QV"] = "demandvorto"                             -- EO
  -- contabwc["QV"] = "kata tanya"                              -- ID
  contabwc["KJ"] = "konjunkcio"                              -- EO
  -- contabwc["KJ"] = "konjungsi"                               -- ID
  contabwc["SJ"] = "subjunkcio (subfrazenkondukilo)"         -- EO
  -- contabwc["SJ"] = "subjungsi (pemberitahu klausa terikat)"  -- ID
  contabwc["PP"] = "prepozicio"                              -- EO
  -- contabwc["PP"] = "preposisi (kata depan)"                  -- ID
  contabwc["PO"] = "postpozicio"                             -- EO
  -- contabwc["PO"] = "postposisi (kata belakang)"              -- ID
  contabwc["PC"] = "cirkumpozicio"                           -- EO
  -- contabwc["PC"] = "sirkumposisi"                            -- ID
  contabwc["AR"] = "artikolo"                                -- EO
  -- contabwc["AR"] = "artikel (kata sandang)"                  -- ID
  contabwc["IN"] = "interjekcio"                             -- EO
  -- contabwc["IN"] = "interjeksi"                              -- ID
  contabwc["PF"] = "prefikso"                         -- EO
  -- contabwc["PF"] = "prefiks (awalan)"                 -- ID
  contabwc["UF"] = "sufikso"                          -- EO
  -- contabwc["UF"] = "sufiks (akhiran)"                 -- ID
  contabwc["KF"] = "cirkumfikso"                      -- EO
  -- contabwc["KF"] = "sirkumfiks (konfiks)"             -- ID
  contabwc["IF"] = "infikso"                          -- EO
  -- contabwc["IF"] = "infiks (sisipan)"                 -- ID
  contabwc["KA"] = "frazo"                            -- EO
  -- contabwc["KA"] = "kalimat"                          -- ID

---- IMPORTS ----

local piktbllki = require(constrplki) -- can crash here

------------------------------------------------------------------------

---- ORDINARY LOCAL LOW LEVEL FUNCTIONS ----

------------------------------------------------------------------------

-- test whether char is a lowercase letter, return bool

local function lftestlc (numcode)
  local boolowerc = true
  if ((numcode<97) or (numcode>122)) then
    boolowerc = false
  end--if
  return boolowerc
end--function lftestlc

------------------------------------------------------------------------

local function lftestuc (numkode) -- test whether char is uppercase
  local booupperc = true
  if ((numkode<65) or (numkode>90)) then
    booupperc = false
  end--if
  return booupperc
end--function lftestuc

local function lfxcasebeg (strucinut,booucas) -- case beginning letter of word
  local numlein = 0
  local numchaer = 0
  local numchaes = 0
  local numcut = 1 -- becomes 2 for unicode char:s
  local booc3blok = false
  local booc4c5bl = false
  local booisuppr = false
  local booislowr = false
  numlein = string.len(strucinut)
  if (numlein~=0) then
    numchaer = string.byte(strucinut,1,1)
    if ((numchaer>127) and (numlein>=2)) then
      numchaes = string.byte(strucinut,2,2)
      numcut = 2
    end--if
    if (numcut==1) then
      booisuppr = ((numchaer>64) and (numchaer< 91))
      booislowr = ((numchaer>96) and (numchaer<123))
      if (booisuppr and (booucas==false)) then
        numchaer = numchaer+32 -- ASCII UPPER->lower
      end--if
      if (booislowr and booucas) then
        numchaer = numchaer-32 -- ASCII lower->UPPER
      end--if
    else
      booc3blok = (numchaer==195) -- case delta is 32
      booc4c5bl = ((numchaer==196) or (numchaer==197)) -- case delta is 1
      if (booc3blok) then
        if ((numchaes>=128) and (numchaes<160)) then
          booisuppr = true -- C3,80...C3,9F
        end--if
        if ((numchaes>=160) and (numchaes<192)) then
          booislowr = true -- C3,A0...C3,BF
        end--if
      end--if
      if (booc4c5bl) then
        if ((numchaes%2)==0) then
          booisuppr = true
        else
          booislowr = true
        end--if
      end--if
      if (booc3blok and booisuppr and (booucas==false)) then
        numchaes = numchaes+32 -- UC UPPER->lower -- holds f AA AE EE NN OE UE
      end--if
      if (booc3blok and booislowr and booucas) then
        numchaes = numchaes-32 -- UC lower->UPPER -- holds f aa ae ee nn oe ue
      end--if
      if (booc4c5bl and booisuppr and (booucas==false)) then
        numchaes = numchaes+1 -- UC UPPER->lower -- holds for JX SX ...
      end--if
      if (booc4c5bl and booislowr and booucas) then
        numchaes = numchaes-1 -- UC lower->UPPER -- holds for jx sx ...
      end--if
    end--if (numcut==1) else
    if (numlein>numcut) then
      strucinut = string.sub(strucinut,(numcut+1),numlein)
    else
      strucinut = ""
    end--if
    if (numcut==1) then
      strucinut = string.char(numchaer) .. strucinut
    else
      strucinut = string.char(numchaer) .. string.char(numchaes) .. strucinut
    end--if
  end--if
  return strucinut
end--function lfxcasebeg

local function lfkodeosg (strsurr) -- EO transcode surrogates to cxapeloj strg
  local varpeek = 0
  local strcxapeloj = ''
  local numinputl = 0
  local numininx = 0
  local numknark = 0 -- current char (ZERO is NOT valid)
  local numknarp = 0 -- previous char (ZERO is NOT valid)
  local numlow = 0
  local numhaj = 0
  numinputl = string.len(strsurr)
  while (true) do
    if (numininx==numinputl) then
      break
    end--if
    numknark = string.byte(strsurr,(numininx+1),(numininx+1))
    numininx = numininx + 1
    numhaj = 0 -- pre-assume no translation
    if ((numknarp~=0) and ((numknark==88) or (numknark==120))) then -- got "x"
      varpeek = contabtransiltable[numknarp] -- UINT16 or nil
      if (varpeek~=nil) then
        numlow = varpeek % 256 -- MOD operator -- bitwise AND operator lacks
        numhaj = math.floor (varpeek / 256) -- DIV operator lacks in LUA :-(
      end--if
    end--if
    if (numhaj~=0) then
      strcxapeloj = strcxapeloj .. string.char(numhaj) .. string.char(numlow)
      numknark = 0 -- invalidade current char
    else
      if (numknarp~=0) then -- add previous char only if valid
        strcxapeloj = strcxapeloj .. string.char(numknarp) -- add it
      end--if
    end--if
    numknarp = numknark -- copy to previous even if invalid
  end--while
  if (numknarp~=0) then -- add previous and last char only if valid
    strcxapeloj = strcxapeloj .. string.char(numknarp) -- add it
  end--if
  return strcxapeloj
end--function lfkodeosg

------------------------------------------------------------------------

---- MAIN EXPORTED FUNCTION ----

------------------------------------------------------------------------

function lawc.ek (mwframent)

  -- general unknown type

  local vartmp = 0     -- variable without type multipurpose

  -- special type "args"

  local arxcaller = 0  -- metaized "args" from caller's "frame" (NOT our own)

  -- general str

  local strkodbah  = ""  -- language code (2 or 3 lowercase) from arxcaller[1]
  local strkodkek  = ""  -- word class code (2 uppercase) from arxcaller[2]
  local strsepkat  = ""  -- the crucial word from arxcaller[3] or pagename
  local strnambah  = ""  -- language name (without prefix "Bahasa")
  local strnambauc = ""  -- language name uppercased begin ("Angla")
  local strnamasin = ""  -- language name in the language
  local strnamkek  = ""  -- word class full
  local strnamkeco = ""  -- word class truncated and uppercased begin
  local strtmp     = ""  -- temp
  local strinv     = ""  -- invisible category part of result string
  local strret     = ""  -- result string

  -- general num

  local numlong = 0
  local numtamp = 0
  local numoct  = 0
  local numodt  = 0

  -- general boo

  local booerr = false     -- fatal error flag
  local boosub = false     -- flag for error in subtemplate, set additionally
  local bookonata = true   -- set to false if "piktbllki" index 0 give invalid
  local boohavasi = false  -- set to true if we have valid nam in "strnamasin"

  ---- SEIZE 2 OBLI + 1 OPTI ARGUMENTS SUBMITTED TO CALLER INTO 3 STRINGS ----

  arxcaller = mwframent:getParent().args -- "args" from caller's "frame"

  if (((arxcaller[1])==nil) or ((arxcaller[2])==nil)) then
    booerr = true
  end--if

  if (booerr==false) then
    strkodbah = arxcaller[1] -- 2 or 3 lc (obligatory)
    numlong = string.len (strkodbah)
    if ((numlong==2) or (numlong==3)) then
      if (strkodbah~='??') then -- "??" is unknown but not faulty
        numoct = string.byte (strkodbah,1,1)
        if (lftestlc(numoct)==false) then
          booerr = true
        end--if
        numoct = string.byte (strkodbah,2,2)
        if (lftestlc(numoct)==false) then
          booerr = true
        end--if
        if (numlong==3) then
          numoct = string.byte (strkodbah,3,3)
          if (lftestlc(numoct)==false) then
            booerr = true
          end--if
        end--if
      end--if (strkodbah~='??') then
    else
      booerr = true -- invalid language code
    end--if ((numlong==2) or (numlong==3)) else
    strkodkek = arxcaller[2] -- 2 UC (obligatory)
    numlong = string.len (strkodkek)
    if (numlong==2) then
      if (strkodkek~='??') then -- "??" is unknown but not faulty
        numoct = string.byte (strkodkek,1,1)
        if (lftestuc(numoct)==false) then
          booerr = true
        end--if
        numoct = string.byte (strkodkek,2,2)
        if (lftestuc(numoct)==false) then
          booerr = true
        end--if
      end--if (strkodkek~='??') then
    else
      booerr = true -- invalid word class code
    end--if (numlong==2) else
  end--if

  if (booerr==false) then
    if (type(arxcaller[3])=="string") then
      strsepkat = arxcaller[3] -- (optional)
      if (strsepkat=="") then
        booerr = true -- empty parameter not appreciated
      else
        vartmp = string.find (strsepkat, "''", 1, true) -- plain text search
        if (vartmp) then
          booerr = true -- multiple apo:s not appreciated
        end--if
      end--if
    end--if (type(arxcaller[3])=="string") then
  end--if

  ---- SEIZE THE PAGENAME IF NEEDED AND AUTOSPLIT IT ----

  if ((booerr==false) and (strsepkat=="")) then
    vartmp = mw.title.getCurrentTitle().text
    if (type(vartmp)=="string") then
      if (string.len(vartmp)~=0) then
        strsepkat = vartmp
      end--if
    end--if
    if (strsepkat=="") then
      booerr = true -- would result in "bad usage" but is hopefully impossible
    end--if
    vartmp = string.find (strsepkat, ' ', 1, true) -- plain text search
    if (vartmp) then -- we must split
      strtmp = strsepkat
      strsepkat = '[['
      numlong = string.len(strtmp)
      numtamp = 0 -- idx for copying from "strtmp" to "strsepkat" with "]] [["
      while (true) do
        if (numtamp==numlong) then
          break -- copied whole string
        end--if
        numoct = string.byte(strtmp,(numtamp+1),(numtamp+1))
        if (numoct==32) then
          strsepkat = strsepkat .. ']] [['
        else
          strsepkat = strsepkat .. string.char(numoct)
        end--if
        numtamp = numtamp + 1
      end--while
      strsepkat = strsepkat .. ']]'
    end--if (vartmp) then
  end--if

  ---- TRANSCODE EO IF NEEDED ----

  if (constrpriv=="eo") then
    constrbadu = lfkodeosg(constrbadu)
    constrsubp = lfkodeosg(constrsubp) -- "Eraro en subsxab" ...
  end--if

  ---- PEEK THE LANGUAGE NAMES VIA SUBMODULE ----

  if (booerr==false) then
    if (strkodbah~='??') then -- "??" is unknown but not faulty
      strnambah = constrneli -- unknown lang
      bookonata = false -- needed below, less evil than "booerr = true"
    else
      strnambah = piktbllki.ek { args = { strkodbah , "0" } } -- l nam no "rl"
      if (strnambah=="=") then
        strtmp = piktbllki.ek { args = { constrpriv , "-" } } -- tes own l cod
        if (strtmp=="1") then
          strnambah = constrneli -- unknown lang (since our own code found)
          bookonata = false -- needed below, less evil than "booerr = true"
        else
          booerr = true -- error (since our own code NOT found either)
          boosub = true
        end--if
      end--if (strnambah=="=")
      if (strnambah=="-") then -- absolutely required ("=" bad, "-" bad too)
        booerr = true
        boosub = true
      end--if
    end--if (strkodbah~='??') else
  end--if

  if ((booerr==false) and bookonata) then
    strnamasin = piktbllki.ek { args = { strkodbah, "1" , "1" } } -- lng asing
    if (strnamasin=="=") then -- not absolutely required ("=" bad, "-" tolera)
      booerr = true
      boosub = true
    else
      if (strnamasin~="=") then
        boohavasi = true -- have valid name better than "-" to display
        strnamasin = constrisobg .. strnamasin .. constrisoen -- add the isola
      end--if
    end--if
  end--if

  --- TRANSLATE WORD CLASS CODE VIA LUA TABLE ----

  if (booerr==false) then
    if (strkodkek~='??') then -- "??" is unknown but not faulty
      strnamkek = constrnekk -- word class full -- unknown word class
    else
      vartmp = contabwc[strkodkek]
      if (vartmp==nil) then
        strnamkek = constrnekk -- word class full -- unknown word class
      else
        strnamkek = vartmp -- word class full -- found it in the table
      end--if
    end--if (strkodkek~='??') else
  end--if

 ---- BREW 2 EXTRA STRING:S ----

  if (booerr==false) then
    strnambauc = lfxcasebeg (strnambah,true) -- language name uppercased begin
    strtmp = lfxcasebeg (strnamkek,true) -- wordclass uppercased begin
    numlong = string.len(strnamkek)
    numtamp = 0 -- index for copying from "strtmp" to "strnamkeco" until " ("
    while (true) do
      if (numtamp==numlong) then
        break -- copied whole string
      end--if
      numoct = string.byte(strtmp,(numtamp+1),(numtamp+1))
      numodt = 0
      if ((numtamp+1)<numlong) then
        numodt = string.byte(strtmp,(numtamp+2),(numtamp+2))
      end--if
      if (numodt==40) then
        break -- stop copying at " (" (2 char:s but only 1 checked)
      end--if
      strnamkeco = strnamkeco .. string.char(numoct) -- was emp -- wc tr uc be
      numtamp = numtamp + 1
    end--while
  end--if

  ---- WHINE IF SOMETHING SUCKS ----

  if (booerr) then
    if (boosub) then
      strret = constrsubp -- problem in subtemplate
    else
      strret = constrbadu -- bad usage (even failure of "getCurrentTitle")
    end--if
  end--if

  ---- BREW THE FINAL STRING - VISIBLE PART ----

  if (booerr==false) then
    strret = '<b><bdi>' .. strsepkat .. '</bdi></b> ' -- lemma and space
    strret = strret .. '( <span ' .. constrtoolt .. ' title="' .. constrbaha .. strnambah
    if (boohavasi) then
      strret = strret .. ' ' .. strnamasin -- lang name in the lang with isola
    end--if
    strret = strret .. '"> ' .. strkodbah .. ' </span> , '
    strret = strret .. '<span ' .. constrtoolt .. ' title="' .. constrkeka .. strnamkek
    strret = strret .. '"> ' .. strkodkek .. ' </span> )'
  end--if

  ---- ENHANCE THE FINAL STRING - INVISIBLE CATEGORY PART ----

  if (booerr==false) then
    if (constrpriv=="eo") then
      strinv = '[[' .. constrkatp .. strnambauc .. ']]' -- lang
      strinv = strinv .. '[[' .. constrkatp .. strnamkeco .. ']]' -- wc
      strinv = strinv .. '[[' .. constrkatp .. strnamkeco .. ' (' .. strnambah .. ')]]'
    end--if
    if (constrpriv=="id") then
      strinv = '[[' .. constrkatp .. 'Kata bahasa ' .. strnambah .. ']]' -- lang
      strinv = strinv .. '[[' .. constrkatp .. strnamkeco .. ']]' -- wc
      strinv = strinv .. '[[' .. constrkatp .. strkodbah .. ':' .. strnamkeco .. ']]'
    end--if
    strret = strret .. strinv
  end--if

  ---- RETURN THE JUNK STRING ----

  return strret

end--function

  ---- RETURN THE JUNK LUA TABLE ----

return lawc