git.schokokeks.org
Repositories
Help
Report an Issue
fs-draft.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
000b5f0
Branches
Tags
master
midgard
vorlage
fs-draft.git
source
content
word_functions.html.php
personal pronouns and infinitive
Christian Fraß
commited
000b5f0
at 2016-05-21 18:25:14
word_functions.html.php
Blame
History
Raw
<?php global $configuration; include_once("source/logic/server/misc.php"); include_once("source/logic/server/data.php"); include_once("source/logic/server/table.php"); ?> <section class="section" id="word_functions"> <header>Word Functions</header> <?php proposal(); ?> <?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) { global $configuration; return ["original" => [$row["example"]["word"]], "translated" => $row["example"]["translations"][$configuration["target"]]]; }, _bar("word") ), ], read_json("source/data/word_functions.json") ); $table->generate(); ?> <p> Some complex examples: <ul> <?php $fun = _bar("word"); ?> <li><?php echo($fun(["original" => ["unmanlikhed"], "translated" => ["inhumanity"]])); ?></li> <li><?php echo($fun(["original" => ["seberenung"], "translated" => ["visualization"]])); ?></li> <li><?php echo($fun(["original" => ["kraftigenar"], "translated" => ["fortifier"]])); ?></li> </ul> </p> </section>