Christian Fraß authored on05/08/2018 20:00:22
Showing1 changed files
... ...
@@ -140,5 +140,5 @@
140 140
 		]
141 141
 	)->generate();
142 142
  ?>
143
-<p><?php echo(format_correlation("type_sentence")(["flk" => ["Vi kan see de huses vindöger"], "eng" => ["We can see the houses windows."]])); ?></p></section>
143
+<p><?php echo(format_correlation("type_sentence")(["flk" => ["Vi kan seje de huses vindöger"], "eng" => ["We can see the houses windows."]])); ?></p></section>
144 144
 
Christian Fraß authored on02/07/2017 19:51:20
Showing0 changed files
Browse code

update

Christian Fraß authored on17/04/2017 03:54:52
Showing1 changed files
... ...
@@ -99,14 +99,14 @@
99 99
 				{
100 100
 					case 0:
101 101
 					{
102
-						return format_list("type_word", "fs")($value[0]["words"]);
102
+						return format_list("type_word", "flk")($value[0]["words"]);
103 103
 						break;
104 104
 					}
105 105
 					case 1:
106 106
 					{
107 107
 						global $configuration;
108 108
 						$value_ = [];
109
-						foreach (["fs",$configuration["target"]] as $language_id)
109
+						foreach (["flk",$configuration["target"]] as $language_id)
110 110
 						{
111 111
 							$value_[$language_id] = array_reduce
112 112
 							(
... ...
@@ -123,7 +123,7 @@
123 123
 							format_correlation("type_word")
124 124
 							(
125 125
 								[
126
-									"fs" => $value_["fs"],
126
+									"flk" => $value_["flk"],
127 127
 									$configuration["target"] => $value_[$configuration["target"]],
128 128
 								]
129 129
 							)
... ...
@@ -140,5 +140,5 @@
140 140
 		]
141 141
 	)->generate();
142 142
  ?>
143
-<p><?php echo(format_correlation("type_sentence")(["fs" => ["Vi kön see de huses vindöger"], "en" => ["We can see the houses windows."]])); ?></p></section>
143
+<p><?php echo(format_correlation("type_sentence")(["flk" => ["Vi kön see de huses vindöger"], "eng" => ["We can see the houses windows."]])); ?></p></section>
144 144
 
Browse code

intermediate

Christian Fraß authored on13/04/2017 19:26:23
Showing1 changed files
... ...
@@ -140,5 +140,5 @@
140 140
 		]
141 141
 	)->generate();
142 142
  ?>
143
-<p><?php echo(format_correlation("type_sentence")(["fs" => ["Vi kön see de huses vindöger"], "en" => ["We can see the houses windows."]])); ?></p></section>
143
+<p><?php echo(format_correlation("type_sentence")(["fs" => ["Vi kan see de huses vindöger"], "en" => ["We can see the houses windows."]])); ?></p></section>
144 144
 
Browse code

added transition-data and table

Christian Fraß authored on27/11/2016 17:30:26
Showing1 changed files
... ...
@@ -99,8 +99,8 @@
99 99
 				{
100 100
 					case 0:
101 101
 					{
102
-						return _baz($value[0]["words"], "word", "fs");
103
-						// break;
102
+						return format_list("type_word", "fs")($value[0]["words"]);
103
+						break;
104 104
 					}
105 105
 					case 1:
106 106
 					{
... ...
@@ -120,26 +120,25 @@
120 120
 							);
121 121
 						}
122 122
 						return (
123
-							_bar("word")
123
+							format_correlation("type_word")
124 124
 							(
125 125
 								[
126
-									"original" => $value_["fs"],
127
-									"translated" => $value_[$configuration["target"]],
126
+									"fs" => $value_["fs"],
127
+									$configuration["target"] => $value_[$configuration["target"]],
128 128
 								]
129 129
 							)
130 130
 						);
131
-						// break;
131
+						break;
132 132
 					}
133 133
 					default:
134 134
 					{
135 135
 						return json_encode($value);
136
-						// break;
136
+						break;
137 137
 					}
138 138
 				}
139 139
 			},
140 140
 		]
141 141
 	)->generate();
142
-?>
143
-<p><span class="sentence lang_fs">Vi kön see de huses vindöger.</span> ~ <span class="sentence lang_en">We can see the houses' windows.</span></p>
144
-</section>
142
+ ?>
143
+<p><?php echo(format_correlation("type_sentence")(["fs" => ["Vi kön see de huses vindöger"], "en" => ["We can see the houses windows."]])); ?></p></section>
145 144
 
Browse code

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

Christian Fraß authored on21/08/2016 23:49:52
Showing1 changed files
... ...
@@ -12,71 +12,133 @@
12 12
  ?>
13 13
 <p>The following table summarizes the information of this section:</p>
14 14
 <?php
15
-$data = [
16
-	[
17
-		"x0" => "nominative",
18
-		"x1" => ["original" => ["en sten"], "translated" => ["a stone"]],
19
-		"x2" => ["original" => ["de sten"], "translated" => ["the stone"]],
20
-		"x3" => ["original" => ["stener"], "translated" => ["stones"]],
21
-		"x4" => ["original" => ["de stener"], "translated" => ["the stones"]],
22
-	],
23
-	[
24
-		"x0" => "accusative",
25
-		"x1" => ["original" => ["en sten"], "translated" => ["a stone"]],
26
-		"x2" => ["original" => ["de sten"], "translated" => ["the stone"]],
27
-		"x3" => ["original" => ["stener"], "translated" => ["stones"]],
28
-		"x4" => ["original" => ["de stener"], "translated" => ["the stones"]],
29
-	],
30
-	[
31
-		"x0" => "dative",
32
-		"x1" => ["original" => ["to en sten"], "translated" => ["(to) a stone"]],
33
-		"x2" => ["original" => ["to de sten"], "translated" => ["(to) the stone"]],
34
-		"x3" => ["original" => ["to stener"], "translated" => ["(to) stones"]],
35
-		"x4" => ["original" => ["to de stener"], "translated" => ["(to) the stones"]],
36
-	],
37
-	[
38
-		"x0" => "genitive",
39
-		"x1" => ["original" => ["en sten(e)s","av en sten"], "translated" => ["a stones","of a stone"]],
40
-		"x2" => ["original" => ["de sten(e)s","av de sten"], "translated" => ["the stones","of the stone"]],
41
-		"x3" => ["original" => ["stener(e)s","av stener"], "translated" => ["stones'","of stones"]],
42
-		"x4" => ["original" => ["de stener(e)s","av de stener"], "translated" => ["the stones'","of the stones"]],
43
-	],
44
-];
45
-(new class_table
46
-(
47
-	[
48
-		new class_column
49
-		(
50
-			"Case",
51
-			"x0"
52
-		),
53
-		new class_column
54
-		(
55
-			"singular indefinite",
56
-			"x1",
57
-			_bar("word")
58
-		),
59
-		new class_column
60
-		(
61
-			"singular definite",
62
-			"x2",
63
-			_bar("word")
64
-		),
65
-		new class_column
66
-		(
67
-			"plural indefinite",
68
-			"x3",
69
-			_bar("word")
70
-		),
71
-		new class_column
72
-		(
73
-			"plural definite",
74
-			"x4",
75
-			_bar("word")
76
-		),
77
-	],
78
-	$data
79
-))->generate();
15
+	$data_common = read_json("source/data/common.json");
16
+	$data_declension = read_json("source/data/declension.json");
17
+	
18
+	$data = $data_declension["words"];
19
+	{
20
+		{
21
+			if (true)
22
+			{
23
+				$data = sql_cross($data, $data_common["counts"]);
24
+				$data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);});
25
+				$data = sql_delete($data, ["count_id", "id"]);
26
+				$data = sql_rename($data, "name", "count_name");
27
+			}
28
+			else
29
+			{
30
+				$data = sql_rename($data, "count_id", "count_name");
31
+			}
32
+		}
33
+		{
34
+			if (true)
35
+			{
36
+				$data = sql_cross($data, $data_common["definitenesses"]);
37
+				$data = sql_select($data, function ($row) {return ($row["definiteness_id"] == $row["id"]);});
38
+				$data = sql_delete($data, ["definiteness_id", "id"]);
39
+				$data = sql_rename($data, "name", "definiteness_name");
40
+			}
41
+			else
42
+			{
43
+				$data = sql_rename($data, "definiteness_id", "definiteness_name");
44
+			}
45
+		}
46
+		{
47
+			if (true)
48
+			{
49
+				$data = sql_cross($data, $data_common["cases"]);
50
+				$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);});
51
+				$data = sql_delete($data, ["case_id", "id"]);
52
+				$data = sql_rename($data, "name", "case_name");
53
+			}
54
+			else
55
+			{
56
+				$data = sql_rename($data, "case_id", "case_name");
57
+			}
58
+		}
59
+	}
60
+	
61
+	$table = new class_table
62
+	(
63
+		[
64
+			new class_column("Language", "language_id"),
65
+			new class_column("Count", "count_name"),
66
+			new class_column("Definiteness", "definiteness_name"),
67
+			new class_column("Case", "case_name"),
68
+			new class_column("Words", "words", function ($x) {return json_encode($x);}),
69
+		],
70
+		$data
71
+	);
72
+	
73
+	$table->snap
74
+	(
75
+		[
76
+			"label_vertical" => function ($column) {return "";},
77
+			"columns_vertical" =>
78
+			[
79
+				$table->columns_get()[1],
80
+				$table->columns_get()[2],
81
+			],
82
+			"label_horizontal" => function ($column, $value) {return $value;},
83
+			"columns_horizontal" =>
84
+			[
85
+				$table->columns_get()[3],
86
+			],
87
+			"columns_data" =>
88
+			[
89
+				$table->columns_get()[0],
90
+				$table->columns_get()[4],
91
+			],
92
+			"data_aggregator" => function ($values)
93
+			{
94
+				return $values;
95
+			},
96
+			"data_formatter" => function ($value)
97
+			{
98
+				switch (1)
99
+				{
100
+					case 0:
101
+					{
102
+						return _baz($value[0]["words"], "word", "fs");
103
+						// break;
104
+					}
105
+					case 1:
106
+					{
107
+						global $configuration;
108
+						$value_ = [];
109
+						foreach (["fs",$configuration["target"]] as $language_id)
110
+						{
111
+							$value_[$language_id] = array_reduce
112
+							(
113
+								array_map
114
+								(
115
+									function ($dataset) {return $dataset["words"];},
116
+									array_filter($value, function ($dataset) use (&$language_id) {return ($dataset["language_id"] == $language_id);})
117
+								),
118
+								function ($x, $y) {return array_merge($x, $y);},
119
+								[]
120
+							);
121
+						}
122
+						return (
123
+							_bar("word")
124
+							(
125
+								[
126
+									"original" => $value_["fs"],
127
+									"translated" => $value_[$configuration["target"]],
128
+								]
129
+							)
130
+						);
131
+						// break;
132
+					}
133
+					default:
134
+					{
135
+						return json_encode($value);
136
+						// break;
137
+					}
138
+				}
139
+			},
140
+		]
141
+	)->generate();
80 142
 ?>
81 143
 <p><span class="sentence lang_fs">Vi kön see de huses vindöger.</span> ~ <span class="sentence lang_en">We can see the houses' windows.</span></p>
82 144
 </section>
Browse code

minor changes

Christian Fraß authored on09/08/2016 01:45:31
Showing1 changed files
... ...
@@ -15,31 +15,31 @@
15 15
 $data = [
16 16
 	[
17 17
 		"x0" => "nominative",
18
-		"x1" => ["original" => ["en dag"], "translated" => ["a day"]],
19
-		"x2" => ["original" => ["de dag"], "translated" => ["the day"]],
20
-		"x3" => ["original" => ["dager"], "translated" => ["days"]],
21
-		"x4" => ["original" => ["de dager"], "translated" => ["the days"]],
18
+		"x1" => ["original" => ["en sten"], "translated" => ["a stone"]],
19
+		"x2" => ["original" => ["de sten"], "translated" => ["the stone"]],
20
+		"x3" => ["original" => ["stener"], "translated" => ["stones"]],
21
+		"x4" => ["original" => ["de stener"], "translated" => ["the stones"]],
22 22
 	],
23 23
 	[
24 24
 		"x0" => "accusative",
25
-		"x1" => ["original" => ["en dag"], "translated" => ["a day"]],
26
-		"x2" => ["original" => ["de dag"], "translated" => ["the day"]],
27
-		"x3" => ["original" => ["dager"], "translated" => ["days"]],
28
-		"x4" => ["original" => ["de dager"], "translated" => ["the days"]],
25
+		"x1" => ["original" => ["en sten"], "translated" => ["a stone"]],
26
+		"x2" => ["original" => ["de sten"], "translated" => ["the stone"]],
27
+		"x3" => ["original" => ["stener"], "translated" => ["stones"]],
28
+		"x4" => ["original" => ["de stener"], "translated" => ["the stones"]],
29 29
 	],
30 30
 	[
31 31
 		"x0" => "dative",
32
-		"x1" => ["original" => ["to en dag"], "translated" => ["(to) a day"]],
33
-		"x2" => ["original" => ["to de dag"], "translated" => ["(to) the day"]],
34
-		"x3" => ["original" => ["to dager"], "translated" => ["(to) days"]],
35
-		"x4" => ["original" => ["to de dager"], "translated" => ["(to) the days"]],
32
+		"x1" => ["original" => ["to en sten"], "translated" => ["(to) a stone"]],
33
+		"x2" => ["original" => ["to de sten"], "translated" => ["(to) the stone"]],
34
+		"x3" => ["original" => ["to stener"], "translated" => ["(to) stones"]],
35
+		"x4" => ["original" => ["to de stener"], "translated" => ["(to) the stones"]],
36 36
 	],
37 37
 	[
38 38
 		"x0" => "genitive",
39
-		"x1" => ["original" => ["en dag(e)s","av en dag"], "translated" => ["a days","of a day"]],
40
-		"x2" => ["original" => ["de dag(e)s","av de dag"], "translated" => ["the days","of the day"]],
41
-		"x3" => ["original" => ["dager(e)s","av dager"], "translated" => ["days'","of days"]],
42
-		"x4" => ["original" => ["de dager(e)s","av de dager"], "translated" => ["the days'","of the days"]],
39
+		"x1" => ["original" => ["en sten(e)s","av en sten"], "translated" => ["a stones","of a stone"]],
40
+		"x2" => ["original" => ["de sten(e)s","av de sten"], "translated" => ["the stones","of the stone"]],
41
+		"x3" => ["original" => ["stener(e)s","av stener"], "translated" => ["stones'","of stones"]],
42
+		"x4" => ["original" => ["de stener(e)s","av de stener"], "translated" => ["the stones'","of the stones"]],
43 43
 	],
44 44
 ];
45 45
 (new class_table
Browse code

repaired tables in content

Christian Fraß authored on08/08/2016 21:50:25
Showing1 changed files
... ...
@@ -14,32 +14,32 @@
14 14
 <?php
15 15
 $data = [
16 16
 	[
17
-		"nominative",
18
-		["original" => ["en dag"], "translated" => ["a day"]],
19
-		["original" => ["de dag"], "translated" => ["the day"]],
20
-		["original" => ["dager"], "translated" => ["days"]],
21
-		["original" => ["de dager"], "translated" => ["the days"]],
17
+		"x0" => "nominative",
18
+		"x1" => ["original" => ["en dag"], "translated" => ["a day"]],
19
+		"x2" => ["original" => ["de dag"], "translated" => ["the day"]],
20
+		"x3" => ["original" => ["dager"], "translated" => ["days"]],
21
+		"x4" => ["original" => ["de dager"], "translated" => ["the days"]],
22 22
 	],
23 23
 	[
24
-		"accusative",
25
-		["original" => ["en dag"], "translated" => ["a day"]],
26
-		["original" => ["de dag"], "translated" => ["the day"]],
27
-		["original" => ["dager"], "translated" => ["days"]],
28
-		["original" => ["de dager"], "translated" => ["the days"]],
24
+		"x0" => "accusative",
25
+		"x1" => ["original" => ["en dag"], "translated" => ["a day"]],
26
+		"x2" => ["original" => ["de dag"], "translated" => ["the day"]],
27
+		"x3" => ["original" => ["dager"], "translated" => ["days"]],
28
+		"x4" => ["original" => ["de dager"], "translated" => ["the days"]],
29 29
 	],
30 30
 	[
31
-		"dative",
32
-		["original" => ["to en dag"], "translated" => ["(to) a day"]],
33
-		["original" => ["to de dag"], "translated" => ["(to) the day"]],
34
-		["original" => ["to dager"], "translated" => ["(to) days"]],
35
-		["original" => ["to de dager"], "translated" => ["(to) the days"]],
31
+		"x0" => "dative",
32
+		"x1" => ["original" => ["to en dag"], "translated" => ["(to) a day"]],
33
+		"x2" => ["original" => ["to de dag"], "translated" => ["(to) the day"]],
34
+		"x3" => ["original" => ["to dager"], "translated" => ["(to) days"]],
35
+		"x4" => ["original" => ["to de dager"], "translated" => ["(to) the days"]],
36 36
 	],
37 37
 	[
38
-		"genitive",
39
-		["original" => ["en dag(e)s","av en dag"], "translated" => ["a days","of a day"]],
40
-		["original" => ["de dag(e)s","av de dag"], "translated" => ["the days","of the day"]],
41
-		["original" => ["dager(e)s","av dager"], "translated" => ["days'","of days"]],
42
-		["original" => ["de dager(e)s","av de dager"], "translated" => ["the days'","of the days"]],
38
+		"x0" => "genitive",
39
+		"x1" => ["original" => ["en dag(e)s","av en dag"], "translated" => ["a days","of a day"]],
40
+		"x2" => ["original" => ["de dag(e)s","av de dag"], "translated" => ["the days","of the day"]],
41
+		"x3" => ["original" => ["dager(e)s","av dager"], "translated" => ["days'","of days"]],
42
+		"x4" => ["original" => ["de dager(e)s","av de dager"], "translated" => ["the days'","of the days"]],
43 43
 	],
44 44
 ];
45 45
 (new class_table
... ...
@@ -48,30 +48,30 @@ $data = [
48 48
 		new class_column
49 49
 		(
50 50
 			"Case",
51
-			function ($row) {return $row[0];}
51
+			"x0"
52 52
 		),
53 53
 		new class_column
54 54
 		(
55 55
 			"singular indefinite",
56
-			function ($row) {return $row[1];},
56
+			"x1",
57 57
 			_bar("word")
58 58
 		),
59 59
 		new class_column
60 60
 		(
61 61
 			"singular definite",
62
-			function ($row) {return $row[2];},
62
+			"x2",
63 63
 			_bar("word")
64 64
 		),
65 65
 		new class_column
66 66
 		(
67 67
 			"plural indefinite",
68
-			function ($row) {return $row[3];},
68
+			"x3",
69 69
 			_bar("word")
70 70
 		),
71 71
 		new class_column
72 72
 		(
73 73
 			"plural definite",
74
-			function ($row) {return $row[4];},
74
+			"x4",
75 75
 			_bar("word")
76 76
 		),
77 77
 	],
Browse code

added some drafts and an example text

Christian Fraß authored on05/06/2016 19:05:53
Showing1 changed files
... ...
@@ -1,5 +1,83 @@
1 1
 <section class="section" id="declension">
2 2
 	<header>Declension</header>
3
-	<span class="todo">all</span>
3
+<?php
4
+	compose
5
+	(
6
+		[
7
+			"numeri",
8
+			"cases",
9
+			"definiteness",
10
+		]
11
+	);
12
+ ?>
13
+<p>The following table summarizes the information of this section:</p>
14
+<?php
15
+$data = [
16
+	[
17
+		"nominative",
18
+		["original" => ["en dag"], "translated" => ["a day"]],
19
+		["original" => ["de dag"], "translated" => ["the day"]],
20
+		["original" => ["dager"], "translated" => ["days"]],
21
+		["original" => ["de dager"], "translated" => ["the days"]],
22
+	],
23
+	[
24
+		"accusative",
25
+		["original" => ["en dag"], "translated" => ["a day"]],
26
+		["original" => ["de dag"], "translated" => ["the day"]],
27
+		["original" => ["dager"], "translated" => ["days"]],
28
+		["original" => ["de dager"], "translated" => ["the days"]],
29
+	],
30
+	[
31
+		"dative",
32
+		["original" => ["to en dag"], "translated" => ["(to) a day"]],
33
+		["original" => ["to de dag"], "translated" => ["(to) the day"]],
34
+		["original" => ["to dager"], "translated" => ["(to) days"]],
35
+		["original" => ["to de dager"], "translated" => ["(to) the days"]],
36
+	],
37
+	[
38
+		"genitive",
39
+		["original" => ["en dag(e)s","av en dag"], "translated" => ["a days","of a day"]],
40
+		["original" => ["de dag(e)s","av de dag"], "translated" => ["the days","of the day"]],
41
+		["original" => ["dager(e)s","av dager"], "translated" => ["days'","of days"]],
42
+		["original" => ["de dager(e)s","av de dager"], "translated" => ["the days'","of the days"]],
43
+	],
44
+];
45
+(new class_table
46
+(
47
+	[
48
+		new class_column
49
+		(
50
+			"Case",
51
+			function ($row) {return $row[0];}
52
+		),
53
+		new class_column
54
+		(
55
+			"singular indefinite",
56
+			function ($row) {return $row[1];},
57
+			_bar("word")
58
+		),
59
+		new class_column
60
+		(
61
+			"singular definite",
62
+			function ($row) {return $row[2];},
63
+			_bar("word")
64
+		),
65
+		new class_column
66
+		(
67
+			"plural indefinite",
68
+			function ($row) {return $row[3];},
69
+			_bar("word")
70
+		),
71
+		new class_column
72
+		(
73
+			"plural definite",
74
+			function ($row) {return $row[4];},
75
+			_bar("word")
76
+		),
77
+	],
78
+	$data
79
+))->generate();
80
+?>
81
+<p><span class="sentence lang_fs">Vi kön see de huses vindöger.</span> ~ <span class="sentence lang_en">We can see the houses' windows.</span></p>
4 82
 </section>
5 83
 
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,5 @@
1
+<section class="section" id="declension">
2
+	<header>Declension</header>
3
+	<span class="todo">all</span>
4
+</section>
5
+