Christian Fraß authored on25/07/2017 09:03:16
Showing1 changed files
... ...
@@ -11,11 +11,21 @@
11 11
 	  -->
12 12
 <?php
13 13
 	$data_adpositions = read_json("source/data/adpositions.json");
14
-	$data = $data_adpositions["words"];
14
+	// $data = $data_adpositions["words"];
15
+	$data = $data_adpositions["situations"];
15 16
 	{
17
+		/*
16 18
 		{
17 19
 			$data = sql_cross($data, $data_adpositions["situations"]);
18 20
 			$data = sql_select($data, function ($row) {return ($row["situation_id"] == $row["id"]);});
21
+			$data = sql_order($data, function ($x, $y) {return ($x["situation_id"] >= $y["situation_id"]);});
22
+			$data = sql_delete($data, ["situation_id", "id"]);
23
+			$data = sql_rename($data, "name", "situation_name");
24
+		}
25
+		 */
26
+		{
27
+			$data = sql_cross($data, $data_adpositions["words"]);
28
+			$data = sql_select($data, function ($row) {return ($row["situation_id"] == $row["id"]);});
19 29
 			$data = sql_delete($data, ["situation_id", "id"]);
20 30
 			$data = sql_rename($data, "name", "situation_name");
21 31
 		}
Browse code

more adpositions

Christian Fraß authored on25/07/2017 08:22:38
Showing1 changed files
... ...
@@ -79,5 +79,11 @@
79 79
 	);
80 80
 	$table_->generate();
81 81
  ?>
82
+ 	<p><?php echo(format_correlation("type_sentence")(["flk" => ["Ek skal varte foran."], "eng" => ["I will wait in front."]])); ?></p>
83
+ 	<p><?php echo(format_correlation("type_sentence")(["flk" => ["Du mut blive bakan."], "eng" => ["You must stay in the back."]])); ?></p>
84
+ 	<p><?php echo(format_correlation("type_sentence")(["flk" => ["Han sta nedan de brüg."], "eng" => ["He stands under the bridge."]])); ?></p>
85
+ 	<p><?php echo(format_correlation("type_sentence")(["flk" => ["Hun flüg uvan de volker."], "eng" => ["She flies above the clouds."]])); ?></p>
86
+ 	<p><?php echo(format_correlation("type_sentence")(["flk" => ["Vi kan gae in de timer."], "eng" => ["We can go into the room."]])); ?></p>
87
+ 	<p><?php echo(format_correlation("type_sentence")(["flk" => ["Je skal löpe ut de hus."], "eng" => ["You shall run out of the house."]])); ?></p>
82 88
 </section>
83 89
 
Browse code

update

Christian Fraß authored on02/07/2017 19:38:23
Showing1 changed files
... ...
@@ -29,7 +29,7 @@
29 29
 			$data = sql_cross($data, $data_adpositions["references"]);
30 30
 			$data = sql_select($data, function ($row) {return ($row["reference_id"] == $row["id"]);});
31 31
 			$data = sql_delete($data, ["reference_id", "id"]);
32
-			$data = sql_rename($data, "name", "kind_name");
32
+			$data = sql_rename($data, "name", "reference_name");
33 33
 		}
34 34
 	}
35 35
 	
... ...
@@ -39,7 +39,7 @@
39 39
 			new class_column("Language", "language_id"),
40 40
 			new class_column("Situation", "situation_name"),
41 41
 			new class_column("Type", "type_name"),
42
-			new class_column("Kind", "kind_name"),
42
+			new class_column("Reference", "reference_name"),
43 43
 			new class_column("Words", "words", function ($x) {return json_encode($x);}),
44 44
 		],
45 45
 		$data
Browse code

added transition-data and table

Christian Fraß authored on27/11/2016 17:30:26
Showing1 changed files
... ...
@@ -26,9 +26,9 @@
26 26
 			$data = sql_rename($data, "name", "type_name");
27 27
 		}
28 28
 		{
29
-			$data = sql_cross($data, $data_adpositions["kinds"]);
30
-			$data = sql_select($data, function ($row) {return ($row["kind_id"] == $row["id"]);});
31
-			$data = sql_delete($data, ["kind_id", "id"]);
29
+			$data = sql_cross($data, $data_adpositions["references"]);
30
+			$data = sql_select($data, function ($row) {return ($row["reference_id"] == $row["id"]);});
31
+			$data = sql_delete($data, ["reference_id", "id"]);
32 32
 			$data = sql_rename($data, "name", "kind_name");
33 33
 		}
34 34
 	}
... ...
@@ -44,7 +44,7 @@
44 44
 		],
45 45
 		$data
46 46
 	);
47
-	$table = $table->snap
47
+	$table_ = $table->snap
48 48
 	(
49 49
 		[
50 50
 			"label_vertical" => function ($column) {return "";},
... ...
@@ -67,22 +67,17 @@
67 67
 			{
68 68
 				return $values;
69 69
 			},
70
-			"data_formatter" => function ($value)
71
-			{
72
-				return (
73
-					_bar("word")
74
-					(
75
-						[
76
-							"original" => $value[0]["words"],
77
-							"translated" => $value[1]["words"],
78
-						]
79
-					)
80
-				);
81
-				return json_encode($value);
82
-			},
70
+			"data_formatter" => function_chain
71
+			(
72
+				[
73
+					object_from_array("language_id"),
74
+					object_map(object_attribute("words")),
75
+					format_correlation("type_word"),
76
+				]
77
+			),
83 78
 		]
84 79
 	);
85
-	$table->generate();
80
+	$table_->generate();
86 81
  ?>
87 82
 </section>
88 83
 
Browse code

repaired tables in content

Christian Fraß authored on08/08/2016 21:50:25
Showing1 changed files
... ...
@@ -10,51 +10,77 @@
10 10
 	<p>The following list gives an overview over prepositions:</p>
11 11
 	  -->
12 12
 <?php
13
+	$data_adpositions = read_json("source/data/adpositions.json");
14
+	$data = $data_adpositions["words"];
15
+	{
16
+		{
17
+			$data = sql_cross($data, $data_adpositions["situations"]);
18
+			$data = sql_select($data, function ($row) {return ($row["situation_id"] == $row["id"]);});
19
+			$data = sql_delete($data, ["situation_id", "id"]);
20
+			$data = sql_rename($data, "name", "situation_name");
21
+		}
22
+		{
23
+			$data = sql_cross($data, $data_adpositions["types"]);
24
+			$data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);});
25
+			$data = sql_delete($data, ["type_id", "id"]);
26
+			$data = sql_rename($data, "name", "type_name");
27
+		}
28
+		{
29
+			$data = sql_cross($data, $data_adpositions["kinds"]);
30
+			$data = sql_select($data, function ($row) {return ($row["kind_id"] == $row["id"]);});
31
+			$data = sql_delete($data, ["kind_id", "id"]);
32
+			$data = sql_rename($data, "name", "kind_name");
33
+		}
34
+	}
35
+	
13 36
 	$table = new class_table
14 37
 	(
15 38
 		[
16
-			/*
17
-			new class_column
18
-			(
19
-				"Type",
20
-				function ($row)
21
-				{
22
-					return $row["type"];
23
-				}
24
-			),
25
-			 */
26
-			new class_column
27
-			(
28
-				"Positive absolute",
29
-				_foo("positive_absolute"),
30
-				_bar("word")
31
-			),
32
-			new class_column
33
-			(
34
-				"Positive relative",
35
-				_foo("positive_relative"),
36
-				_bar("word")
37
-			),
38
-			new class_column
39
-			(
40
-				"Positive attributive",
41
-				_foo("positive_attributive"),
42
-				_bar("word")
43
-			),
44
-			new class_column
45
-			(
46
-				"Directive absolute",
47
-				_foo("directive_absolute"),
48
-				_bar("word")
49
-			),
50
-			new class_column
51
-			(
52
-				"Directive relative",
53
-				_foo("directive_relative"),
54
-				_bar("word")
55
-			),
39
+			new class_column("Language", "language_id"),
40
+			new class_column("Situation", "situation_name"),
41
+			new class_column("Type", "type_name"),
42
+			new class_column("Kind", "kind_name"),
43
+			new class_column("Words", "words", function ($x) {return json_encode($x);}),
56 44
 		],
57
-		read_json("source/data/adpositions.json")
45
+		$data
46
+	);
47
+	$table = $table->snap
48
+	(
49
+		[
50
+			"label_vertical" => function ($column) {return "";},
51
+			"columns_vertical" =>
52
+			[
53
+				$table->columns_get()[1],
54
+			],
55
+			"label_horizontal" => function ($column, $value) {return $value;},
56
+			"columns_horizontal" =>
57
+			[
58
+				$table->columns_get()[2],
59
+				$table->columns_get()[3],
60
+			],
61
+			"columns_data" =>
62
+			[
63
+				$table->columns_get()[0],
64
+				$table->columns_get()[4],
65
+			],
66
+			"data_aggregator" => function ($values)
67
+			{
68
+				return $values;
69
+			},
70
+			"data_formatter" => function ($value)
71
+			{
72
+				return (
73
+					_bar("word")
74
+					(
75
+						[
76
+							"original" => $value[0]["words"],
77
+							"translated" => $value[1]["words"],
78
+						]
79
+					)
80
+				);
81
+				return json_encode($value);
82
+			},
83
+		]
58 84
 	);
59 85
 	$table->generate();
60 86
  ?>
Browse code

personal pronouns and infinitive

Christian Fraß authored on21/05/2016 18:25:14
Showing1 changed files
... ...
@@ -5,7 +5,10 @@
5 5
  ?>
6 6
 <section class="section" id="adpositions">
7 7
 	<header>Adpositions</header>
8
-	<div class="note_error">This section is only a proposal yet; not part of the draft.</div>
8
+	<?php proposal(); ?>
9
+	<!--
10
+	<p>The following list gives an overview over prepositions:</p>
11
+	  -->
9 12
 <?php
10 13
 	$table = new class_table
11 14
 	(
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,59 @@
1
+<?php
2
+	include_once("source/logic/server/data.php");
3
+	include_once("source/logic/server/table.php");
4
+	include_once("source/logic/server/misc.php");
5
+ ?>
6
+<section class="section" id="adpositions">
7
+	<header>Adpositions</header>
8
+	<div class="note_error">This section is only a proposal yet; not part of the draft.</div>
9
+<?php
10
+	$table = new class_table
11
+	(
12
+		[
13
+			/*
14
+			new class_column
15
+			(
16
+				"Type",
17
+				function ($row)
18
+				{
19
+					return $row["type"];
20
+				}
21
+			),
22
+			 */
23
+			new class_column
24
+			(
25
+				"Positive absolute",
26
+				_foo("positive_absolute"),
27
+				_bar("word")
28
+			),
29
+			new class_column
30
+			(
31
+				"Positive relative",
32
+				_foo("positive_relative"),
33
+				_bar("word")
34
+			),
35
+			new class_column
36
+			(
37
+				"Positive attributive",
38
+				_foo("positive_attributive"),
39
+				_bar("word")
40
+			),
41
+			new class_column
42
+			(
43
+				"Directive absolute",
44
+				_foo("directive_absolute"),
45
+				_bar("word")
46
+			),
47
+			new class_column
48
+			(
49
+				"Directive relative",
50
+				_foo("directive_relative"),
51
+				_bar("word")
52
+			),
53
+		],
54
+		read_json("source/data/adpositions.json")
55
+	);
56
+	$table->generate();
57
+ ?>
58
+</section>
59
+