git.schokokeks.org
Repositories
Help
Report an Issue
fs-draft.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
9b21fc2
Branches
Tags
master
midgard
vorlage
fs-draft.git
source
structure
personal_pronouns.html.php
advanced
Fenris Wolf
commited
9b21fc2
at 2016-04-22 17:27:38
personal_pronouns.html.php
Blame
History
Raw
<?php $data = [ [ "numerus" => 1, "persona" => 0, "genus" => 0, "fs" => ["man"], "en" => ["one","you"], ], [ "numerus" => 1, "persona" => 1, "genus" => 0, "fs" => ["ek"], "en" => ["i"], ], [ "numerus" => 1, "persona" => 2, "genus" => 0, "fs" => ["du"], "en" => ["you","thou"], ], [ "numerus" => 1, "persona" => 3, "genus" => 0, "fs" => ["han"], "en" => [], ], [ "numerus" => 1, "persona" => 3, "genus" => 1, "fs" => ["hin"], "en" => ["hi"], ], [ "numerus" => 1, "persona" => 3, "genus" => 2, "fs" => ["hun"], "en" => ["she"], ], [ "numerus" => 1, "persona" => 3, "genus" => 3, "fs" => ["het"], "en" => ["it"], ], [ "numerus" => 2, "persona" => 0, "genus" => 0, "fs" => ["man"], "en" => ["they","you"], ], [ "numerus" => 2, "persona" => 1, "genus" => 0, "fs" => ["vi"], "en" => ["we"], ], [ "numerus" => 2, "persona" => 2, "genus" => 0, "fs" => ["je"], "en" => ["you (all)"], ], [ "numerus" => 2, "persona" => 3, "genus" => 0, "fs" => ["di"], "en" => ["they"], ], ]; function convert_numerus($numerus) { switch ($numerus) { case 0: { return NULL; break; } case 1: { return "singular"; break; } case 2: { return "plural"; break; } default: { throw ("invalid"); break; } } } function convert_persona($persona) { switch ($persona) { case 0: { return "impersonal"; break; } case 1: { return "1st person"; break; } case 2: { return "2nd person"; break; } case 3: { return "3rd person"; break; } default: { throw ("invalid"); break; } } } function convert_genus($genus) { switch ($genus) { case 0: { return "common"; break; } case 1: { return "masculine"; break; } case 2: { return "feminine"; break; } case 3: { return "neuter"; break; } default: { throw ("invalid"); break; } } } ?> <section class="subsection" id="grammar/pronouns/personal_pronouns"> <header>Personal Pronouns</header> <table> <thead> <tr> <th>Case</th> <th>Folksprak</th> <th>English</th> </tr> </thead> <tbody> <?php foreach ($data as $entry) { $entry_desc = implode( " / ", [ convert_persona($entry["persona"]), convert_numerus($entry["numerus"]), convert_genus($entry["genus"]), ] ); $entry_fs = implode(", ", array_map(function ($word) {return ('<span class="word_fs">' . $word . '</span>');}, $entry["fs"])); $entry_en = implode(", ", array_map(function ($word) {return ('<span class="word_en">' . $word . '</span>');}, $entry["en"])); ?> <tr> <td><?php echo($entry_desc); ?></td> <td><?php echo($entry_fs); ?></td> <td><?php echo($entry_en); ?></td> </tr> <?php } ?> </tbody> </table> </section>