Browse code

fs -> flk

Christian Fraß authored on27/07/2017 00:19:14
Showing1 changed files
... ...
@@ -17,7 +17,7 @@
17 17
 				"affix",
18 18
 				function ($value)
19 19
 				{
20
-					return mark($value, ["type_word", "lang_fs"]);
20
+					return mark($value, ["type_word", "lang_flk"]);
21 21
 				}
22 22
 			),
23 23
 			new class_column
Browse code

update

Christian Fraß authored on17/04/2017 03:54:52
Showing1 changed files
... ...
@@ -95,9 +95,9 @@
95 95
 <p>
96 96
 	Some complex examples:
97 97
 	<ul>
98
-		<li><?php echo(format_correlation("word")(["fs" => ["unmanlikhed"], "en" => ["inhumanity"]])); ?></li>
99
-		<li><?php echo(format_correlation("word")(["fs" => ["seberenung"], "en" => ["visualization"]])); ?></li>
100
-		<li><?php echo(format_correlation("word")(["fs" => ["kraftigenar"], "en" => ["fortifier"]])); ?></li>
98
+		<li><?php echo(format_correlation("word")(["flk" => ["unmanlikhed"], "eng" => ["inhumanity"]])); ?></li>
99
+		<li><?php echo(format_correlation("word")(["flk" => ["seberenung"], "eng" => ["visualization"]])); ?></li>
100
+		<li><?php echo(format_correlation("word")(["flk" => ["kraftigenar"], "eng" => ["fortifier"]])); ?></li>
101 101
 	</ul>
102 102
 </p>
103 103
 </section>
Browse code

added transition-data and table

Christian Fraß authored on27/11/2016 17:30:26
Showing1 changed files
... ...
@@ -17,7 +17,7 @@
17 17
 				"affix",
18 18
 				function ($value)
19 19
 				{
20
-					return mark($value, ["word", "lang_fs"]);
20
+					return mark($value, ["type_word", "lang_fs"]);
21 21
 				}
22 22
 			),
23 23
 			new class_column
... ...
@@ -70,6 +70,12 @@
70 70
 				"Example",
71 71
 				"example_",
72 72
 				_bar("word")
73
+				/*
74
+				function ($x)
75
+				{
76
+					return json_encode($x);
77
+				}
78
+				 */
73 79
 			),
74 80
 		],
75 81
 		sql_condense
... ...
@@ -89,10 +95,9 @@
89 95
 <p>
90 96
 	Some complex examples:
91 97
 	<ul>
92
-		<?php $fun = _bar("word"); ?>
93
-		<li><?php echo($fun(["original" => ["unmanlikhed"], "translated" => ["inhumanity"]])); ?></li>
94
-		<li><?php echo($fun(["original" => ["seberenung"], "translated" => ["visualization"]])); ?></li>
95
-		<li><?php echo($fun(["original" => ["kraftigenar"], "translated" => ["fortifier"]])); ?></li>
98
+		<li><?php echo(format_correlation("word")(["fs" => ["unmanlikhed"], "en" => ["inhumanity"]])); ?></li>
99
+		<li><?php echo(format_correlation("word")(["fs" => ["seberenung"], "en" => ["visualization"]])); ?></li>
100
+		<li><?php echo(format_correlation("word")(["fs" => ["kraftigenar"], "en" => ["fortifier"]])); ?></li>
96 101
 	</ul>
97 102
 </p>
98 103
 </section>
Browse code

repaired tables in content

Christian Fraß authored on08/08/2016 21:50:25
Showing1 changed files
... ...
@@ -14,10 +14,7 @@
14 14
 			new class_column
15 15
 			(
16 16
 				"Affix",
17
-				function ($row)
18
-				{
19
-					return $row["affix"];
20
-				},
17
+				"affix",
21 18
 				function ($value)
22 19
 				{
23 20
 					return mark($value, ["word", "lang_fs"]);
... ...
@@ -26,10 +23,7 @@
26 23
 			new class_column
27 24
 			(
28 25
 				"Type",
29
-				function ($row)
30
-				{
31
-					return [$row["type_from"], $row["type_to"]];
32
-				},
26
+				"type_",
33 27
 				function ($value)
34 28
 				{
35 29
 					return (
... ...
@@ -51,10 +45,7 @@
51 45
 			new class_column
52 46
 			(
53 47
 				"Description",
54
-				function ($row)
55
-				{
56
-					return ["name" => $row["name"], "description" => $row["description"]];
57
-				},
48
+				"description_",
58 49
 				function ($value)
59 50
 				{
60 51
 					$output = "";
... ...
@@ -67,10 +58,7 @@
67 58
 			new class_column
68 59
 			(
69 60
 				"Cognates",
70
-				function ($row)
71
-				{
72
-					return $row["cognates"];
73
-				},
61
+				"cognates",
74 62
 				function ($value)
75 63
 				{
76 64
 					return implode(", ", array_map(function ($entry) {return ($entry["language"] . ": " . mark($entry["affix"], ["word", "lang_" . $entry["language"]]));}, $value));
... ...
@@ -80,15 +68,21 @@
80 68
 			new class_column
81 69
 			(
82 70
 				"Example",
83
-				function ($row)
84
-				{
85
-					global $configuration;
86
-					return ["original" => [$row["example"]["word"]], "translated" => $row["example"]["translations"][$configuration["target"]]];
87
-				},
71
+				"example_",
88 72
 				_bar("word")
89 73
 			),
90 74
 		],
91
-		read_json("source/data/word_functions.json")
75
+		sql_condense
76
+		(
77
+			read_json("source/data/word_functions.json"),
78
+			["type_from","type_to","name","description","example"],
79
+			["type_","description_","example_"],
80
+			[
81
+				"type_" => function ($values) {return [$values["type_from"], $values["type_to"]];},
82
+				"description_" => function ($values) {return ["name" => $values["name"], "description" => $values["description"]];},
83
+				"example_" => function ($values) {global $configuration; return ["original" => [$values["example"]["word"]], "translated" => $values["example"]["translations"][$configuration["target"]]];},
84
+			]
85
+		)
92 86
 	);
93 87
 	$table->generate();
94 88
  ?>
Browse code

personal pronouns and infinitive

Christian Fraß authored on21/05/2016 18:25:14
Showing1 changed files
... ...
@@ -6,7 +6,7 @@
6 6
  ?>
7 7
 <section class="section" id="word_functions">
8 8
 	<header>Word Functions</header>
9
-	<div class="note_error">This section is only a proposal yet; not part of the draft.</div>
9
+	<?php proposal(); ?>
10 10
 <?php
11 11
 	$table = new class_table
12 12
 	(
Browse code

renamed structure to content

Christian Fraß authored on15/05/2016 20:38:28
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,105 @@
1
+<?php
2
+	global $configuration;
3
+	include_once("source/logic/server/misc.php");
4
+	include_once("source/logic/server/data.php");
5
+	include_once("source/logic/server/table.php");
6
+ ?>
7
+<section class="section" id="word_functions">
8
+	<header>Word Functions</header>
9
+	<div class="note_error">This section is only a proposal yet; not part of the draft.</div>
10
+<?php
11
+	$table = new class_table
12
+	(
13
+		[
14
+			new class_column
15
+			(
16
+				"Affix",
17
+				function ($row)
18
+				{
19
+					return $row["affix"];
20
+				},
21
+				function ($value)
22
+				{
23
+					return mark($value, ["word", "lang_fs"]);
24
+				}
25
+			),
26
+			new class_column
27
+			(
28
+				"Type",
29
+				function ($row)
30
+				{
31
+					return [$row["type_from"], $row["type_to"]];
32
+				},
33
+				function ($value)
34
+				{
35
+					return (
36
+						implode
37
+						(
38
+							" → ",
39
+							array_map
40
+							(
41
+								function ($group)
42
+								{
43
+				 					return ("{" . implode(",", $group) . "}");
44
+								},
45
+								$value
46
+							)
47
+						)
48
+					);
49
+				}
50
+			),
51
+			new class_column
52
+			(
53
+				"Description",
54
+				function ($row)
55
+				{
56
+					return ["name" => $row["name"], "description" => $row["description"]];
57
+				},
58
+				function ($value)
59
+				{
60
+					$output = "";
61
+					if ($value["name"] != null) $output .= (mark($value["name"], ["grammarterm"]) . ": ");
62
+					if ($value["description"] != null) $output .= ($value["description"]);
63
+					return $output;
64
+				}
65
+			),
66
+			/*
67
+			new class_column
68
+			(
69
+				"Cognates",
70
+				function ($row)
71
+				{
72
+					return $row["cognates"];
73
+				},
74
+				function ($value)
75
+				{
76
+					return implode(", ", array_map(function ($entry) {return ($entry["language"] . ": " . mark($entry["affix"], ["word", "lang_" . $entry["language"]]));}, $value));
77
+				}
78
+			),
79
+			 */
80
+			new class_column
81
+			(
82
+				"Example",
83
+				function ($row)
84
+				{
85
+					global $configuration;
86
+					return ["original" => [$row["example"]["word"]], "translated" => $row["example"]["translations"][$configuration["target"]]];
87
+				},
88
+				_bar("word")
89
+			),
90
+		],
91
+		read_json("source/data/word_functions.json")
92
+	);
93
+	$table->generate();
94
+ ?>
95
+<p>
96
+	Some complex examples:
97
+	<ul>
98
+		<?php $fun = _bar("word"); ?>
99
+		<li><?php echo($fun(["original" => ["unmanlikhed"], "translated" => ["inhumanity"]])); ?></li>
100
+		<li><?php echo($fun(["original" => ["seberenung"], "translated" => ["visualization"]])); ?></li>
101
+		<li><?php echo($fun(["original" => ["kraftigenar"], "translated" => ["fortifier"]])); ?></li>
102
+	</ul>
103
+</p>
104
+</section>
105
+