git.schokokeks.org
Repositories
Help
Report an Issue
fs-draft.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
18080c6
Branches
Tags
master
midgard
vorlage
fs-draft.git
source
structure
word_functions.html.php
foo
fenris
commited
18080c6
at 2016-04-24 18:00:07
word_functions.html.php
Blame
History
Raw
<?php global $configuration; include_once("source/logic/server/data.php"); include_once("source/logic/server/table.php"); ?> <section class="section" id="grammar/word_functions"> <header>Word Functions</header> <?php $table = new class_table ( [ new class_column ( "Affix", function ($row) { return $row["affix"]; }, function ($value) { return mark($value, ["word", "lang_fs"]); } ), new class_column ( "Type", function ($row) { return [$row["type_from"], $row["type_to"]]; }, function ($value) { return ( implode ( " → ", array_map ( function ($group) { return ("{" . implode(",", $group) . "}"); }, $value ) ) ); } ), new class_column ( "Description", function ($row) { return ["name" => $row["name"], "description" => $row["description"]]; }, function ($value) { $output = ""; if ($value["name"] != null) $output .= (mark($value["name"], ["grammarterm"]) . ": "); if ($value["description"] != null) $output .= ($value["description"]); return $output; } ), /* new class_column ( "Cognates", function ($row) { return $row["cognates"]; }, function ($value) { return implode(", ", array_map(function ($entry) {return ($entry["language"] . ": " . mark($entry["affix"], ["word", "lang_" . $entry["language"]]));}, $value)); } ), */ new class_column ( "Example", function ($row) { return $row["example"]; }, function ($value) { global $configuration; $from = mark($value["word"], ["word", "lang_fs"]); $to = implode ( ", ", array_map ( function ($word) { global $configuration; return mark($word, ["word", "lang_" . $configuration["target"]]); }, $value["translations"][$configuration["target"]] ) ); return ($from . " ~ " . $to); } ), ], read_json("source/data/word_functions.json") ); $table->generate(); ?> <p> Some complex examples: <ul> <li><span class="word lang_fs">unmanlikhed</span> ~ <span class="word lang_en">inhumanity</span></li> <li><span class="word lang_fs">seberenung</span> ~ <span class="word lang_en">visualization</span></li> <li><span class="word lang_fs">kraftigenar</span> ~ <span class="word lang_en">fortifier</span></li> </ul> </p> </section>