Volatile:ClassMatrix: Difference between revisions

(New page: {{#def:ALL|{{#SearchTitle:{{{1}}} }}}} {{#def:X-AXIS|{{#lua: local H = {}; local T = {}; for id in stdin:gmatch("%w+") do str = string.sub(id,{{{2}}},{{{3}}}); if (H[str] ==...)
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#def:ALL|{{#SearchTitle:{{{1}}} }}}}
{{#def:ALL|{{#SearchTitle:{{#get:1}} }}}}


{{#def:X-AXIS|{{#lua:
{{#def:X-AXIS|{{#invoke:ClassMatrix|XAxis|{{#var:ALL}}|{{#get:2}}|{{#get:3}}}}}}
  local H = {};
 
  local T = {};
{{#def:Y-AXIS|{{#invoke:ClassMatrix|YAxis|{{#var:ALL}}|{{#get:4}}|{{#get:5}}}}}}
  for id in stdin:gmatch("%w+") do
    str = string.sub(id,{{{2}}},{{{3}}});
    if (H[str] == nil)
      then H[str] = 1; table.insert(T, str);
      else H[str] = H[str] + 1;
    end
  end
  table.sort(T);
  for i=1,table.getn(T) do
    local k = T[i];
    print(k .. " " .. H[k]);
  end
|{{#var:ALL}}
}}
}}


{{#def:Y-AXIS|{{#lua:
{{#def:MATR|{{#invoke:ClassMatrix|Matr|{{#var:X-AXIS}}&&{{#var:Y-AXIS}}&&{{#var:ALL}}|{{#get:1}}|{{#get:2}}|{{#get:3}}|{{#get:4}}|{{#get:5}}}}}}
  local H = {};
  local T = {};
  for id in stdin:gmatch("%w+") do
    str = string.sub(id,{{{4}}},{{{5}}});
    if (H[str] == nil)
      then H[str] = 1; table.insert(T, str);
      else H[str] = H[str] + 1;
    end
  end
  table.sort(T);
  for i=1,table.getn(T) do
    local k = T[i];
    print(k .. " " .. H[k]);
  end
|{{#var:ALL}}
}}
}}


{{#def:MATR|
{{Twocolumn|
{{#lua:
This page is a classified matrix of molecular pages based on two class categories (rows and columns). You can reach actual molecules by clicking each number with a link (except for 0).
  local input = stdin:match(".+");
|
  local xaxis, yaxis, all = string.match(input, "([^&]+)&&([^&]+)&&(.+)");
これは二つのクラス分類(行と列方向)に基づく分子ページの集計ページです。実際の分子ページへは数字のリンクをクリックしてください。
  local M = {};
  for id in string.gmatch(all,"(%S+)") do
    x = string.sub(id, {{{2}}}, {{{3}}});
    y = string.sub(id, {{{4}}}, {{{5}}});
    if (M[x] == nil) then M[x] = {}; end
    if (M[x][y] == nil)
      then M[x][y] = 1;
      else M[x][y] = M[x][y] + 1;
    end
  end
  strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
  strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
  strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
  for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
    str = x .. " <small>(" .. v .. ")</small>&&";
    for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do
      if (M[x][y] == nil)
        then str = str .. " 0 dummy";
        else str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd;
      end
    end
    print(str);
  end
|{{#var:X-AXIS}}&&{{#var:Y-AXIS}}&&{{#var:ALL}}
}}
}}
}}


{| class=wikitable style="margin:0 auto"
{| class=wikitable style="margin:0 auto"
|+ style="font-weight:bold" | Rows: {{{6|}}}, Columns: {{{7|}}} (counts)
|+ style="font-weight:bold" | Rows: {{#get:6}}, Columns: {{#get:7}} (counts)
|-
|-
!
!

Latest revision as of 02:44, 30 January 2023





This page is a classified matrix of molecular pages based on two class categories (rows and columns). You can reach actual molecules by clicking each number with a link (except for 0).

これは二つのクラス分類(行と列方向)に基づく分子ページの集計ページです。実際の分子ページへは数字のリンクをクリックしてください。

Rows: , Columns: (counts)
{{{1}}}