Browse code

fs -> flk

Christian Fraß authored on27/07/2017 00:19:14
Showing1 changed files
... ...
@@ -142,17 +142,17 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
142 142
  ?>
143 143
 	<div class="note note_information">
144 144
 		<span class="note_content">
145
-			<p>Since the word <?php echo(mark("man", ["type_word", "lang_fs"])); ?> simply means <?php echo(mark("human being", ["type_word", "lang_en"])); ?>, it can be understood as an implicit way to express an abstract actor; similar words like <?php echo(mark("lüd", ["type_word", "lang_fs"])); ?> (<?php echo(mark("people", ["type_word", "lang_en"])); ?>) or <?php echo(mark("di", ["type_word", "lang_fs"])); ?> can be used as well.</p>
145
+			<p>Since the word <?php echo(mark("man", ["type_word", "lang_flk"])); ?> simply means <?php echo(mark("human being", ["type_word", "lang_en"])); ?>, it can be understood as an implicit way to express an abstract actor; similar words like <?php echo(mark("lüd", ["type_word", "lang_flk"])); ?> (<?php echo(mark("people", ["type_word", "lang_en"])); ?>) or <?php echo(mark("di", ["type_word", "lang_flk"])); ?> can be used as well.</p>
146 146
 		</span>
147 147
 	</div>
148 148
 	<div class="note note_information">
149 149
 		<span class="note_content">
150
-			<p>The honorific salutation is expressed by the plural form <?php echo(mark("je", ["type_word", "lang_fs"])); ?>; however it should be avoided in usual speech in favor of the singular form <?php echo(mark("du", ["type_word", "lang_fs"])); ?>.</p>
150
+			<p>The honorific salutation is expressed by the plural form <?php echo(mark("je", ["type_word", "lang_flk"])); ?>; however it should be avoided in usual speech in favor of the singular form <?php echo(mark("du", ["type_word", "lang_flk"])); ?>.</p>
151 151
 		</span>
152 152
 	</div>
153 153
 	<div class="note note_information">
154 154
 		<span class="note_content">
155
-			<p>A reflexive genitive can be formed by inserting the word <?php echo(mark("egen", ["word", "lang_fs"])); ?> (<?php echo(mark("own", ["type_word", "lang_en"])); ?>), for example <?php echo(format_correlation("type_sentence")(["flk" => ["Han (A) hav givt to ham (B) hans egen buk."], "eng" => ["He (A) has given (to) him (B) his own book."]])); ?> (A's book was given to B).</p>
155
+			<p>A reflexive genitive can be formed by inserting the word <?php echo(mark("egen", ["word", "lang_flk"])); ?> (<?php echo(mark("own", ["type_word", "lang_en"])); ?>), for example <?php echo(format_correlation("type_sentence")(["flk" => ["Han (A) hav givt to ham (B) hans egen buk."], "eng" => ["He (A) has given (to) him (B) his own book."]])); ?> (A's book was given to B).</p>
156 156
 		</span>
157 157
 	</div>
158 158
 	<div class="note note_reasoning">
... ...
@@ -160,7 +160,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
160 160
 		<label class="note_label note_label_show" for="note_02">show</label>
161 161
 		<label class="note_label note_label_hide" for="note_02">hide</label>
162 162
 		<span class="note_content">
163
-			<p>When finding appropriate personal pronouns, the most intricate cases were the 3rd person singular and the 2nd person plural; both turned out to be very diverse among the modern Germanic languages. While for the 2nd person plural we could find a sufficient satisfying solution after a while, the 3rd person singular kept defying. In the end we came to the settlement to use a Swedish-like solution including the pronoun <?php echo(mark("hen", ["type_word", "lang_fs"])); ?>, which is not bound to any sexus so that it can be used for actors in general.</p>
163
+			<p>When finding appropriate personal pronouns, the most intricate cases were the 3rd person singular and the 2nd person plural; both turned out to be very diverse among the modern Germanic languages. While for the 2nd person plural we could find a sufficient satisfying solution after a while, the 3rd person singular kept defying. In the end we came to the settlement to use a Swedish-like solution including the pronoun <?php echo(mark("hen", ["type_word", "lang_flk"])); ?>, which is not bound to any sexus so that it can be used for actors in general.</p>
164 164
 		</span>
165 165
 	</div>
166 166
 </section>
Browse code

update

Christian Fraß authored on17/04/2017 03:54:52
Showing1 changed files
... ...
@@ -87,7 +87,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
87 87
 	
88 88
 	{
89 89
 		// $data = sql_select($data, function ($row) {return ($row["type_name"] == "nor");});
90
-		$data = sql_select($data, function ($row) {global $configuration; return (($row["language_id"] == "fs") or ($row["language_id"] == $configuration["target"]));});
90
+		$data = sql_select($data, function ($row) {global $configuration; return (($row["language_id"] == "flk") or ($row["language_id"] == $configuration["target"]));});
91 91
 	}
92 92
 	
93 93
 	$table = new class_table
... ...
@@ -152,7 +152,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
152 152
 	</div>
153 153
 	<div class="note note_information">
154 154
 		<span class="note_content">
155
-			<p>A reflexive genitive can be formed by inserting the word <?php echo(mark("egen", ["word", "lang_fs"])); ?> (<?php echo(mark("own", ["type_word", "lang_en"])); ?>), for example <?php echo(format_correlation("type_sentence")(["fs" => ["Han (A) hav givt to ham (B) hans egen buk."], "en" => ["He (A) has given (to) him (B) his own book."]])); ?> (A's book was given to B).</p>
155
+			<p>A reflexive genitive can be formed by inserting the word <?php echo(mark("egen", ["word", "lang_fs"])); ?> (<?php echo(mark("own", ["type_word", "lang_en"])); ?>), for example <?php echo(format_correlation("type_sentence")(["flk" => ["Han (A) hav givt to ham (B) hans egen buk."], "eng" => ["He (A) has given (to) him (B) his own book."]])); ?> (A's book was given to B).</p>
156 156
 		</span>
157 157
 	</div>
158 158
 	<div class="note note_reasoning">
Browse code

added transition-data and table

Christian Fraß authored on27/11/2016 17:30:26
Showing1 changed files
... ...
@@ -129,66 +129,30 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
129 129
 			{
130 130
 				return $values;
131 131
 			},
132
-			"data_formatter" => function ($value)
133
-			{
134
-				switch (1)
135
-				{
136
-					case 0:
137
-					{
138
-						return _baz($value[0]["words"], "word", "fs");
139
-						// break;
140
-					}
141
-					case 1:
142
-					{
143
-						global $configuration;
144
-						$value_ = [];
145
-						foreach (["fs",$configuration["target"]] as $language_id)
146
-						{
147
-							$value_[$language_id] = array_reduce
148
-							(
149
-								array_map
150
-								(
151
-									function ($dataset) {return $dataset["words"];},
152
-									array_filter($value, function ($dataset) use (&$language_id) {return ($dataset["language_id"] == $language_id);})
153
-								),
154
-								function ($x, $y) {return array_merge($x, $y);},
155
-								[]
156
-							);
157
-						}
158
-						return (
159
-							_bar("word")
160
-							(
161
-								[
162
-									"original" => $value_["fs"],
163
-									"translated" => $value_[$configuration["target"]],
164
-								]
165
-							)
166
-						);
167
-						// break;
168
-					}
169
-					default:
170
-					{
171
-						return json_encode($value);
172
-						// break;
173
-					}
174
-				}
175
-			},
132
+			"data_formatter" => function_chain
133
+			(
134
+				[
135
+					object_from_array("language_id"),
136
+					object_map(object_attribute("words")),
137
+					format_correlation("type_word"),
138
+				]
139
+			),
176 140
 		]
177 141
 	)->generate();
178 142
  ?>
179 143
 	<div class="note note_information">
180 144
 		<span class="note_content">
181
-			<p>Since the word <span class="word lang_fs">man</span> simply means <span class="word lang_en">human being</span>, it can be understood as an implicit way to express an abstract actor; similar words like <span class="word lang_fs">lüd</span> (<span class="word lang_en">people</span>) or <span class="word lang_fs">di</span> can be used as well.</p>
145
+			<p>Since the word <?php echo(mark("man", ["type_word", "lang_fs"])); ?> simply means <?php echo(mark("human being", ["type_word", "lang_en"])); ?>, it can be understood as an implicit way to express an abstract actor; similar words like <?php echo(mark("lüd", ["type_word", "lang_fs"])); ?> (<?php echo(mark("people", ["type_word", "lang_en"])); ?>) or <?php echo(mark("di", ["type_word", "lang_fs"])); ?> can be used as well.</p>
182 146
 		</span>
183 147
 	</div>
184 148
 	<div class="note note_information">
185 149
 		<span class="note_content">
186
-			<p>The honorific salutation is expressed by the plural form <span class="word lang_fs">je</span>; however it should be avoided in usual speech in favor of the singular form <span class="word lang_fs">du</span>.</p>
150
+			<p>The honorific salutation is expressed by the plural form <?php echo(mark("je", ["type_word", "lang_fs"])); ?>; however it should be avoided in usual speech in favor of the singular form <?php echo(mark("du", ["type_word", "lang_fs"])); ?>.</p>
187 151
 		</span>
188 152
 	</div>
189 153
 	<div class="note note_information">
190 154
 		<span class="note_content">
191
-			<p>A reflexive genitive can be formed by inserting the word <span class="word lang_fs">egen</span> (<span class="word lang_en">own</span>), for example <span class="sentence lang_fs">Han (A) hav givt to ham (B) hans egen buk.</span> ~ <span class="sentence lang_en">He (A) has given (to) him (B) his own book.</span> (A's book was given to B).</p>
155
+			<p>A reflexive genitive can be formed by inserting the word <?php echo(mark("egen", ["word", "lang_fs"])); ?> (<?php echo(mark("own", ["type_word", "lang_en"])); ?>), for example <?php echo(format_correlation("type_sentence")(["fs" => ["Han (A) hav givt to ham (B) hans egen buk."], "en" => ["He (A) has given (to) him (B) his own book."]])); ?> (A's book was given to B).</p>
192 156
 		</span>
193 157
 	</div>
194 158
 	<div class="note note_reasoning">
... ...
@@ -196,7 +160,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
196 160
 		<label class="note_label note_label_show" for="note_02">show</label>
197 161
 		<label class="note_label note_label_hide" for="note_02">hide</label>
198 162
 		<span class="note_content">
199
-			<p>When finding appropriate personal pronouns, the most intricate cases were the 3rd person singular and the 2nd person plural; both turned out to be very diverse among the modern Germanic languages. While for the 2nd person plural we could find a sufficient satisfying solution after a while, the 3rd person singular kept defying. In the end we came to the settlement to use a Swedish-like solution including the pronoun <span class="word lang_fs">hen</span>, which is not bound to any sexus so that it can be used for actors in general.</p>
163
+			<p>When finding appropriate personal pronouns, the most intricate cases were the 3rd person singular and the 2nd person plural; both turned out to be very diverse among the modern Germanic languages. While for the 2nd person plural we could find a sufficient satisfying solution after a while, the 3rd person singular kept defying. In the end we came to the settlement to use a Swedish-like solution including the pronoun <?php echo(mark("hen", ["type_word", "lang_fs"])); ?>, which is not bound to any sexus so that it can be used for actors in general.</p>
200 164
 		</span>
201 165
 	</div>
202 166
 </section>
Browse code

added reflexive-nominative pronouns; minor changes

Christian Fraß authored on22/08/2016 11:12:20
Showing1 changed files
... ...
@@ -86,7 +86,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
86 86
 	}
87 87
 	
88 88
 	{
89
-		// $data = sql_select($data, function ($row) {return ($row["case_name"] != "pos");});
89
+		// $data = sql_select($data, function ($row) {return ($row["type_name"] == "nor");});
90 90
 		$data = sql_select($data, function ($row) {global $configuration; return (($row["language_id"] == "fs") or ($row["language_id"] == $configuration["target"]));});
91 91
 	}
92 92
 	
... ...
@@ -191,5 +191,13 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
191 191
 			<p>A reflexive genitive can be formed by inserting the word <span class="word lang_fs">egen</span> (<span class="word lang_en">own</span>), for example <span class="sentence lang_fs">Han (A) hav givt to ham (B) hans egen buk.</span> ~ <span class="sentence lang_en">He (A) has given (to) him (B) his own book.</span> (A's book was given to B).</p>
192 192
 		</span>
193 193
 	</div>
194
+	<div class="note note_reasoning">
195
+		<input type="checkbox" class="note_hide" title="click to show/hide" id="note_02"/>
196
+		<label class="note_label note_label_show" for="note_02">show</label>
197
+		<label class="note_label note_label_hide" for="note_02">hide</label>
198
+		<span class="note_content">
199
+			<p>When finding appropriate personal pronouns, the most intricate cases were the 3rd person singular and the 2nd person plural; both turned out to be very diverse among the modern Germanic languages. While for the 2nd person plural we could find a sufficient satisfying solution after a while, the 3rd person singular kept defying. In the end we came to the settlement to use a Swedish-like solution including the pronoun <span class="word lang_fs">hen</span>, which is not bound to any sexus so that it can be used for actors in general.</p>
200
+		</span>
201
+	</div>
194 202
 </section>
195 203
 
Browse code

included developer-notes; altered correlative (ing -> ni)

Christian Fraß authored on21/08/2016 23:49:52
Showing1 changed files
... ...
@@ -71,7 +71,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
71 71
 			}
72 72
 		}
73 73
 		{
74
-			if (true)
74
+			if (false)
75 75
 			{
76 76
 				$data = sql_cross($data, $data_common["cases"]);
77 77
 				$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
... ...
@@ -110,7 +110,6 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
110 110
 			"label_vertical" => function ($column) {return "";},
111 111
 			"columns_vertical" =>
112 112
 			[
113
-				$table->columns_get()[4],
114 113
 				$table->columns_get()[1],
115 114
 				$table->columns_get()[2],
116 115
 				$table->columns_get()[3],
... ...
@@ -118,6 +117,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
118 117
 			"label_horizontal" => function ($column, $value) {return $value;},
119 118
 			"columns_horizontal" =>
120 119
 			[
120
+				$table->columns_get()[4],
121 121
 				$table->columns_get()[5],
122 122
 			],
123 123
 			"columns_data" =>
... ...
@@ -176,8 +176,20 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
176 176
 		]
177 177
 	)->generate();
178 178
  ?>
179
-	<p>Since the word <span class="word lang_fs">man</span> simply means <span class="word lang_en">human being</span>, it can be understood as an implicit way to express an abstract actor; similar words like <span class="word lang_fs">lüd</span> (<span class="word lang_en">people</span>) or <span class="word lang_fs">di</span> can be used as well.</p>
180
-	<div class="note_information">The honorific salutation is expressed by the plural form <span class="word lang_fs">je</span>; however it should be avoided in usual speech in favor of the singular form <span class="word lang_fs">du</span>.</div>
181
-	<div class="note_information">A reflexive genitive can be formed by inserting the word <span class="word lang_fs">egen</span> (<span class="word lang_en">own</span>), for example <span class="sentence lang_fs">Han[A] hav givt to ham[B] hans egen buk.</span> ~ <span class="sentence lang_en">He[A] has given (to) him[B] his own book.</span> (A's book was given to B).</div>
179
+	<div class="note note_information">
180
+		<span class="note_content">
181
+			<p>Since the word <span class="word lang_fs">man</span> simply means <span class="word lang_en">human being</span>, it can be understood as an implicit way to express an abstract actor; similar words like <span class="word lang_fs">lüd</span> (<span class="word lang_en">people</span>) or <span class="word lang_fs">di</span> can be used as well.</p>
182
+		</span>
183
+	</div>
184
+	<div class="note note_information">
185
+		<span class="note_content">
186
+			<p>The honorific salutation is expressed by the plural form <span class="word lang_fs">je</span>; however it should be avoided in usual speech in favor of the singular form <span class="word lang_fs">du</span>.</p>
187
+		</span>
188
+	</div>
189
+	<div class="note note_information">
190
+		<span class="note_content">
191
+			<p>A reflexive genitive can be formed by inserting the word <span class="word lang_fs">egen</span> (<span class="word lang_en">own</span>), for example <span class="sentence lang_fs">Han (A) hav givt to ham (B) hans egen buk.</span> ~ <span class="sentence lang_en">He (A) has given (to) him (B) his own book.</span> (A's book was given to B).</p>
192
+		</span>
193
+	</div>
182 194
 </section>
183 195
 
Browse code

minor changes; move to koralle-build-system

Christian Fraß authored on09/08/2016 01:17:44
Showing1 changed files
... ...
@@ -71,7 +71,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
71 71
 			}
72 72
 		}
73 73
 		{
74
-			if (false)
74
+			if (true)
75 75
 			{
76 76
 				$data = sql_cross($data, $data_common["cases"]);
77 77
 				$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
... ...
@@ -87,6 +87,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
87 87
 	
88 88
 	{
89 89
 		// $data = sql_select($data, function ($row) {return ($row["case_name"] != "pos");});
90
+		$data = sql_select($data, function ($row) {global $configuration; return (($row["language_id"] == "fs") or ($row["language_id"] == $configuration["target"]));});
90 91
 	}
91 92
 	
92 93
 	$table = new class_table
... ...
@@ -103,12 +104,13 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
103 104
 		$data
104 105
 	);
105 106
 	
106
-	$table = $table->snap
107
+	$table->snap
107 108
 	(
108 109
 		[
109 110
 			"label_vertical" => function ($column) {return "";},
110 111
 			"columns_vertical" =>
111 112
 			[
113
+				$table->columns_get()[4],
112 114
 				$table->columns_get()[1],
113 115
 				$table->columns_get()[2],
114 116
 				$table->columns_get()[3],
... ...
@@ -116,7 +118,6 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
116 118
 			"label_horizontal" => function ($column, $value) {return $value;},
117 119
 			"columns_horizontal" =>
118 120
 			[
119
-				$table->columns_get()[4],
120 121
 				$table->columns_get()[5],
121 122
 			],
122 123
 			"columns_data" =>
... ...
@@ -139,12 +140,27 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
139 140
 					}
140 141
 					case 1:
141 142
 					{
143
+						global $configuration;
144
+						$value_ = [];
145
+						foreach (["fs",$configuration["target"]] as $language_id)
146
+						{
147
+							$value_[$language_id] = array_reduce
148
+							(
149
+								array_map
150
+								(
151
+									function ($dataset) {return $dataset["words"];},
152
+									array_filter($value, function ($dataset) use (&$language_id) {return ($dataset["language_id"] == $language_id);})
153
+								),
154
+								function ($x, $y) {return array_merge($x, $y);},
155
+								[]
156
+							);
157
+						}
142 158
 						return (
143 159
 							_bar("word")
144 160
 							(
145 161
 								[
146
-									"original" => $value[0]["words"],
147
-									"translated" => $value[1]["words"],
162
+									"original" => $value_["fs"],
163
+									"translated" => $value_[$configuration["target"]],
148 164
 								]
149 165
 							)
150 166
 						);
... ...
@@ -158,9 +174,10 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
158 174
 				}
159 175
 			},
160 176
 		]
161
-	);
162
-	$table->generate();
177
+	)->generate();
163 178
  ?>
164
-	<p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#declension">Declension</a>.</p>
179
+	<p>Since the word <span class="word lang_fs">man</span> simply means <span class="word lang_en">human being</span>, it can be understood as an implicit way to express an abstract actor; similar words like <span class="word lang_fs">lüd</span> (<span class="word lang_en">people</span>) or <span class="word lang_fs">di</span> can be used as well.</p>
180
+	<div class="note_information">The honorific salutation is expressed by the plural form <span class="word lang_fs">je</span>; however it should be avoided in usual speech in favor of the singular form <span class="word lang_fs">du</span>.</div>
181
+	<div class="note_information">A reflexive genitive can be formed by inserting the word <span class="word lang_fs">egen</span> (<span class="word lang_en">own</span>), for example <span class="sentence lang_fs">Han[A] hav givt to ham[B] hans egen buk.</span> ~ <span class="sentence lang_en">He[A] has given (to) him[B] his own book.</span> (A's book was given to B).</div>
165 182
 </section>
166 183
 
Browse code

improved look of pronoun-table

Christian Fraß authored on08/08/2016 22:04:51
Showing1 changed files
... ...
@@ -19,43 +19,76 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
19 19
 	$data = $data_pronouns["words"];
20 20
 	{
21 21
 		{
22
-			$data = sql_cross($data, $data_common["counts"]);
23
-			$data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);});
24
-			$data = sql_delete($data, ["count_id", "id"]);
25
-			$data = sql_rename($data, "name", "count_name");
22
+			if (false)
23
+			{
24
+				$data = sql_cross($data, $data_common["counts"]);
25
+				$data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);});
26
+				$data = sql_delete($data, ["count_id", "id"]);
27
+				$data = sql_rename($data, "name", "count_name");
28
+			}
29
+			else
30
+			{
31
+				$data = sql_rename($data, "count_id", "count_name");
32
+			}
26 33
 		}
27 34
 		{
28
-			$data = sql_cross($data, $data_common["persons"]);
29
-			$data = sql_select($data, function ($row) {return ($row["person_id"] == $row["id"]);});
30
-			$data = sql_delete($data, ["person_id", "id"]);
31
-			$data = sql_rename($data, "name", "person_name");
35
+			if (false)
36
+			{
37
+				$data = sql_cross($data, $data_common["persons"]);
38
+				$data = sql_select($data, function ($row) {return ($row["person_id"] == $row["id"]);});
39
+				$data = sql_delete($data, ["person_id", "id"]);
40
+				$data = sql_rename($data, "name", "person_name");
41
+			}
42
+			else
43
+			{
44
+				$data = sql_rename($data, "person_id", "person_name");
45
+			}
32 46
 		}
33 47
 		{
34
-			$data = sql_cross($data, $data_common["genders"]);
35
-			$data = sql_select($data, function ($row) {return ($row["gender_id"] == $row["id"]);});
36
-			$data = sql_delete($data, ["gender_id", "id"]);
37
-			$data = sql_rename($data, "name", "gender_name");
48
+			if (false)
49
+			{
50
+				$data = sql_cross($data, $data_common["genders"]);
51
+				$data = sql_select($data, function ($row) {return ($row["gender_id"] == $row["id"]);});
52
+				$data = sql_delete($data, ["gender_id", "id"]);
53
+				$data = sql_rename($data, "name", "gender_name");
54
+			}
55
+			else
56
+			{
57
+				$data = sql_rename($data, "gender_id", "gender_name");
58
+			}
38 59
 		}
39 60
 		{
40
-			$data = sql_cross($data, $data_pronouns["types"]);
41
-			/*
42
-			$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
43
-			$data = sql_delete($data, ["type_id", "id"]);
44
-			$data = sql_rename($data, "name", "type_name");
45
-			 */
46
-			$data = sql_rename($data, "type_id", "type_name");
61
+			if (false)
62
+			{
63
+				$data = sql_cross($data, $data_pronouns["types"]);
64
+				$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
65
+				$data = sql_delete($data, ["type_id", "id"]);
66
+				$data = sql_rename($data, "name", "type_name");
67
+			}
68
+			else
69
+			{
70
+				$data = sql_rename($data, "type_id", "type_name");
71
+			}
47 72
 		}
48 73
 		{
49
-			$data = sql_cross($data, $data_common["cases"]);
50
-			/*
51
-			$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
52
-			$data = sql_delete($data, ["case_id", "id"]);
53
-			$data = sql_rename($data, "name", "case_name");
54
-			 */
55
-			$data = sql_rename($data, "case_id", "case_name");
74
+			if (false)
75
+			{
76
+				$data = sql_cross($data, $data_common["cases"]);
77
+				$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
78
+				$data = sql_delete($data, ["case_id", "id"]);
79
+				$data = sql_rename($data, "name", "case_name");
80
+			}
81
+			else
82
+			{
83
+				$data = sql_rename($data, "case_id", "case_name");
84
+			}
56 85
 		}
57 86
 	}
58 87
 	
88
+	{
89
+		// $data = sql_select($data, function ($row) {return ($row["case_name"] != "pos");});
90
+	}
91
+	
59 92
 	$table = new class_table
60 93
 	(
61 94
 		[
... ...
@@ -97,7 +130,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
97 130
 			},
98 131
 			"data_formatter" => function ($value)
99 132
 			{
100
-				switch (-1)
133
+				switch (1)
101 134
 				{
102 135
 					case 0:
103 136
 					{
Browse code

repaired tables in content

Christian Fraß authored on08/08/2016 21:50:25
Showing1 changed files
... ...
@@ -4,15 +4,17 @@ include_once("source/logic/server/data.php");
4 4
 include_once("source/logic/server/sql.php");
5 5
 include_once("source/logic/server/table.php");
6 6
 
7
+/*
7 8
 function convert_persona($persona) {return [0 => "impersonal", 1 => "1st person", 2 => "2nd person", 3 => "3rd person"][$persona];}
8 9
 function convert_numerus($numerus) {return [0 => null, 1 => "singular", 2 => "plural"][$numerus];}
9 10
 function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "feminine", 3 => "neuter"][$genus];}
11
+ */
10 12
  ?>
11 13
 <section class="subsection" id="personal_pronouns">
12 14
 	<header>Personal Pronouns</header>
13 15
 <?php
14
-	$data_common = read_json("../../data/common.json");
15
-	$data_pronouns = read_json("../../data/personal_pronouns.json");
16
+	$data_common = read_json("source/data/common.json");
17
+	$data_pronouns = read_json("source/data/personal_pronouns.json");
16 18
 	
17 19
 	$data = $data_pronouns["words"];
18 20
 	{
... ...
@@ -36,15 +38,21 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
36 38
 		}
37 39
 		{
38 40
 			$data = sql_cross($data, $data_pronouns["types"]);
41
+			/*
39 42
 			$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
40 43
 			$data = sql_delete($data, ["type_id", "id"]);
41 44
 			$data = sql_rename($data, "name", "type_name");
45
+			 */
46
+			$data = sql_rename($data, "type_id", "type_name");
42 47
 		}
43 48
 		{
44 49
 			$data = sql_cross($data, $data_common["cases"]);
50
+			/*
45 51
 			$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
46 52
 			$data = sql_delete($data, ["case_id", "id"]);
47 53
 			$data = sql_rename($data, "name", "case_name");
54
+			 */
55
+			$data = sql_rename($data, "case_id", "case_name");
48 56
 		}
49 57
 	}
50 58
 	
... ...
@@ -68,15 +76,15 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
68 76
 			"label_vertical" => function ($column) {return "";},
69 77
 			"columns_vertical" =>
70 78
 			[
71
-				$table->columns_get()[4],
72
-				$table->columns_get()[5],
79
+				$table->columns_get()[1],
80
+				$table->columns_get()[2],
81
+				$table->columns_get()[3],
73 82
 			],
74 83
 			"label_horizontal" => function ($column, $value) {return $value;},
75 84
 			"columns_horizontal" =>
76 85
 			[
77
-				$table->columns_get()[1],
78
-				$table->columns_get()[2],
79
-				$table->columns_get()[3],
86
+				$table->columns_get()[4],
87
+				$table->columns_get()[5],
80 88
 			],
81 89
 			"columns_data" =>
82 90
 			[
... ...
@@ -89,16 +97,32 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
89 97
 			},
90 98
 			"data_formatter" => function ($value)
91 99
 			{
92
-				return (
93
-					_bar("words")
94
-					(
95
-						[
96
-							"original" => $value[0]["words"],
97
-							"translated" => $value[1]["words"],
98
-						]
99
-					)
100
-				);
101
-				return json_encode($value);
100
+				switch (-1)
101
+				{
102
+					case 0:
103
+					{
104
+						return _baz($value[0]["words"], "word", "fs");
105
+						// break;
106
+					}
107
+					case 1:
108
+					{
109
+						return (
110
+							_bar("word")
111
+							(
112
+								[
113
+									"original" => $value[0]["words"],
114
+									"translated" => $value[1]["words"],
115
+								]
116
+							)
117
+						);
118
+						// break;
119
+					}
120
+					default:
121
+					{
122
+						return json_encode($value);
123
+						// break;
124
+					}
125
+				}
102 126
 			},
103 127
 		]
104 128
 	);
Browse code

better table-snap

Christian Fraß authored on08/08/2016 20:58:42
Showing1 changed files
... ...
@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 global $configuration;
3 3
 include_once("source/logic/server/data.php");
4
+include_once("source/logic/server/sql.php");
4 5
 include_once("source/logic/server/table.php");
5 6
 
6 7
 function convert_persona($persona) {return [0 => "impersonal", 1 => "1st person", 2 => "2nd person", 3 => "3rd person"][$persona];}
... ...
@@ -10,54 +11,96 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
10 11
 <section class="subsection" id="personal_pronouns">
11 12
 	<header>Personal Pronouns</header>
12 13
 <?php
14
+	$data_common = read_json("../../data/common.json");
15
+	$data_pronouns = read_json("../../data/personal_pronouns.json");
16
+	
17
+	$data = $data_pronouns["words"];
18
+	{
19
+		{
20
+			$data = sql_cross($data, $data_common["counts"]);
21
+			$data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);});
22
+			$data = sql_delete($data, ["count_id", "id"]);
23
+			$data = sql_rename($data, "name", "count_name");
24
+		}
25
+		{
26
+			$data = sql_cross($data, $data_common["persons"]);
27
+			$data = sql_select($data, function ($row) {return ($row["person_id"] == $row["id"]);});
28
+			$data = sql_delete($data, ["person_id", "id"]);
29
+			$data = sql_rename($data, "name", "person_name");
30
+		}
31
+		{
32
+			$data = sql_cross($data, $data_common["genders"]);
33
+			$data = sql_select($data, function ($row) {return ($row["gender_id"] == $row["id"]);});
34
+			$data = sql_delete($data, ["gender_id", "id"]);
35
+			$data = sql_rename($data, "name", "gender_name");
36
+		}
37
+		{
38
+			$data = sql_cross($data, $data_pronouns["types"]);
39
+			$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
40
+			$data = sql_delete($data, ["type_id", "id"]);
41
+			$data = sql_rename($data, "name", "type_name");
42
+		}
43
+		{
44
+			$data = sql_cross($data, $data_common["cases"]);
45
+			$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
46
+			$data = sql_delete($data, ["case_id", "id"]);
47
+			$data = sql_rename($data, "name", "case_name");
48
+		}
49
+	}
50
+	
13 51
 	$table = new class_table
14 52
 	(
15 53
 		[
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
-			),
54
+			new class_column("Language", "language_id"),
55
+			new class_column("Count", "count_name"),
56
+			new class_column("Person", "person_name"),
57
+			new class_column("Gender", "gender_name"),
58
+			new class_column("Type", "type_name"),
59
+			new class_column("Case", "case_name"),
60
+			new class_column("Words", "words", function ($x) {return json_encode($x);}),
59 61
 		],
60
-		read_json("source/data/personal_pronouns.json")
62
+		$data
63
+	);
64
+	
65
+	$table = $table->snap
66
+	(
67
+		[
68
+			"label_vertical" => function ($column) {return "";},
69
+			"columns_vertical" =>
70
+			[
71
+				$table->columns_get()[4],
72
+				$table->columns_get()[5],
73
+			],
74
+			"label_horizontal" => function ($column, $value) {return $value;},
75
+			"columns_horizontal" =>
76
+			[
77
+				$table->columns_get()[1],
78
+				$table->columns_get()[2],
79
+				$table->columns_get()[3],
80
+			],
81
+			"columns_data" =>
82
+			[
83
+				$table->columns_get()[0],
84
+				$table->columns_get()[6],
85
+			],
86
+			"data_aggregator" => function ($values)
87
+			{
88
+				return $values;
89
+			},
90
+			"data_formatter" => function ($value)
91
+			{
92
+				return (
93
+					_bar("words")
94
+					(
95
+						[
96
+							"original" => $value[0]["words"],
97
+							"translated" => $value[1]["words"],
98
+						]
99
+					)
100
+				);
101
+				return json_encode($value);
102
+			},
103
+		]
61 104
 	);
62 105
 	$table->generate();
63 106
  ?>
Browse code

personal pronouns and infinitive

Christian Fraß authored on21/05/2016 18:25:14
Showing1 changed files
... ...
@@ -9,7 +9,6 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
9 9
  ?>
10 10
 <section class="subsection" id="personal_pronouns">
11 11
 	<header>Personal Pronouns</header>
12
-	<div class="note_error">This section is only a proposal yet; not part of the draft.</div>
13 12
 <?php
14 13
 	$table = new class_table
15 14
 	(
... ...
@@ -62,6 +61,6 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f
62 61
 	);
63 62
 	$table->generate();
64 63
  ?>
65
-	<p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#grammar/declension">Declension</a>.</p>
64
+	<p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#declension">Declension</a>.</p>
66 65
 </section>
67 66
 
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,67 @@
1
+<?php
2
+global $configuration;
3
+include_once("source/logic/server/data.php");
4
+include_once("source/logic/server/table.php");
5
+
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];}
9
+ ?>
10
+<section class="subsection" id="personal_pronouns">
11
+	<header>Personal Pronouns</header>
12
+	<div class="note_error">This section is only a proposal yet; not part of the draft.</div>
13
+<?php
14
+	$table = new class_table
15
+	(
16
+		[
17
+			new class_column
18
+			(
19
+				"Case",
20
+				function ($row)
21
+				{
22
+					return [
23
+						convert_persona($row["persona"]),
24
+						convert_numerus($row["numerus"]),
25
+						convert_genus($row["genus"]),
26
+					];
27
+				},
28
+				function ($value)
29
+				{
30
+					return implode(" / ", $value);
31
+				}
32
+			),
33
+			/*
34
+			 */
35
+			new class_column
36
+			(
37
+				$configuration["languagemap"]["fs"],
38
+				function ($row)
39
+				{
40
+					return $row["fs"];
41
+				},
42
+				function ($value)
43
+				{
44
+					return implode(", ", array_map(function ($word) {return mark($word, ["word", "lang_fs"]);}, $value));
45
+				}
46
+			),
47
+			new class_column
48
+			(
49
+				$configuration["languagemap"][$configuration["target"]],
50
+				function ($row)
51
+				{
52
+					global $configuration;
53
+					return $row[$configuration["target"]];
54
+				},
55
+				function ($value)
56
+				{
57
+					return ((count($value) == 0) ? "--" : implode(", ", array_map(function ($word) {global $configuration; return mark($word, ["word", "lang_" . $configuration["target"]]);}, $value)));
58
+				}
59
+			),
60
+		],
61
+		read_json("source/data/personal_pronouns.json")
62
+	);
63
+	$table->generate();
64
+ ?>
65
+	<p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#grammar/declension">Declension</a>.</p>
66
+</section>
67
+