18080c63cada1df8fd6e8eda7bb06c367e016975
Fenris Wolf advanced

Fenris Wolf authored 8 years ago

1) <?php
fenris advanced

fenris authored 8 years ago

2) global $configuration;
3) include_once("source/logic/server/data.php");
fenris foo

fenris authored 8 years ago

4) include_once("source/logic/server/table.php");
Fenris Wolf advanced

Fenris Wolf authored 8 years ago

5) 
fenris foo

fenris authored 8 years ago

6) function convert_persona($persona) {return [0 => "impersonal", 1 => "1st person", 2 => "2nd person", 3 => "3rd person"][$persona];}
7) function convert_numerus($numerus) {return [0 => null, 1 => "singular", 2 => "plural"][$numerus];}
8) function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "feminine", 3 => "neuter"][$genus];}
Fenris Wolf advanced

Fenris Wolf authored 8 years ago

9)  ?>
10) <section class="subsection" id="grammar/pronouns/personal_pronouns">
11) 	<header>Personal Pronouns</header>
12) <?php
fenris foo

fenris authored 8 years ago

13) 	$table = new class_table
14) 	(
15) 		[
16) 			new class_column
17) 			(
18) 				"Case",
19) 				function ($row)
20) 				{
21) 					return [
22) 						convert_persona($row["persona"]),
23) 						convert_numerus($row["numerus"]),
24) 						convert_genus($row["genus"]),
25) 					];
26) 				},
27) 				function ($value)
28) 				{
29) 					return implode(" / ", $value);
30) 				}
31) 			),
32) 			/*
33) 			 */
34) 			new class_column
35) 			(
36) 				$configuration["languagemap"]["fs"],
37) 				function ($row)
38) 				{
39) 					return $row["fs"];
40) 				},
41) 				function ($value)
42) 				{
43) 					return implode(", ", array_map(function ($word) {return mark($word, ["word", "lang_fs"]);}, $value));
44) 				}
45) 			),
46) 			new class_column
47) 			(
48) 				$configuration["languagemap"][$configuration["target"]],
49) 				function ($row)
50) 				{
51) 					global $configuration;
52) 					return $row[$configuration["target"]];
53) 				},
54) 				function ($value)
55) 				{
56) 					return ((count($value) == 0) ? "--" : implode(", ", array_map(function ($word) {global $configuration; return mark($word, ["word", "lang_" . $configuration["target"]]);}, $value)));
57) 				}
58) 			),
59) 		],
60) 		read_json("source/data/personal_pronouns.json")
61) 	);
62) 	$table->generate();
Fenris Wolf advanced

Fenris Wolf authored 8 years ago

63)  ?>
fenris foo

fenris authored 8 years ago

64) 	<p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#grammar/declension">Declension</a>.</p>