-
Notifications
You must be signed in to change notification settings - Fork 0
/
statistics.php
137 lines (129 loc) · 4.09 KB
/
statistics.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
echo '<h2>Statistics</h2>';
$stats_maps1 = $db->query("SELECT * FROM `maps2_`");
foreach ($stats_maps1 as $rows2) {
$stats_maps1_no++;
${'stats_lang1_' . $rows2['lang']}++;
if ($rows2['meaning_1']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
if ($rows2['meaning_2']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
if ($rows2['meaning_3']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
if ($rows2['meaning_4']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
if ($rows2['meaning_5']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
if ($rows2['meaning_6']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
if ($rows2['meaning_7']) {
${'stats_lang_meanings1_' . $rows2['lang']}++;
$stats_maps2_no++;
}
}
echo '<h4>Number of terms</h4>';
foreach ($languagelist_alpha[1] as $rows3) {
$get_longlang = array_search($rows3,$languagelist_alpha[1]);
$query_longlang = $languagelist_alpha[0][$get_longlang];
echo '<strong>'.$query_longlang.':</strong> '.${'stats_lang1_'.$rows3}.'<br>';
}
echo '<strong>Total: '.$stats_maps1_no.'</strong>';
echo '<h4>Number of meanings</h4>
<p>Counts all individual meanings of every single term</p>';
foreach ($languagelist_alpha[1] as $rows4) {
$get_longlang = array_search($rows4,$languagelist_alpha[1]);
$query_longlang = $languagelist_alpha[0][$get_longlang];
echo '<strong>'.$query_longlang.':</strong> '.${'stats_lang_meanings1_'.$rows4}.'<br>';
}
echo '<strong>Total: '.$stats_maps2_no.'</strong>';
echo '<h4>English meaning descriptions</h4>
<p>This is also the number of all dedicated meanings known to the database</p>';
$stats_maps_meanings1 = $db->query("SELECT * FROM `maps_meanings2_`");
foreach ($stats_maps_meanings1 as $rows5) {
if ($rows5['language'] == 'English') {
if ($rows5['meaning_1']) {
$stats_lang_meanings_english++;
}
if ($rows5['meaning_2']) {
$stats_lang_meanings_english++;
}
if ($rows5['meaning_3']) {
$stats_lang_meanings_english++;
}
if ($rows5['meaning_4']) {
$stats_lang_meanings_english++;
}
if ($rows5['meaning_5']) {
$stats_lang_meanings_english++;
}
if ($rows5['meaning_6']) {
$stats_lang_meanings_english++;
}
if (($rows5['meaning_7']) AND ($rows5['meaning_7'] !='Other')) { // !!
$stats_lang_meanings_english++;
}
}
else {
foreach ($languagelist_alpha[1] as $rows6) {
$get_longlang = array_search($rows6,$languagelist_alpha[1]);
$query_longlang = $languagelist_alpha[0][$get_longlang];
if ($rows5['language'] == $query_longlang) {
if ($rows5['meaning_1']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
if ($rows5['meaning_2']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
if ($rows5['meaning_3']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
if ($rows5['meaning_4']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
if ($rows5['meaning_5']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
if ($rows5['meaning_6']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
if ($rows5['meaning_7']) {
${'stats_lang_meanings2_' . $rows6}++;
$stats_lang_meanings_slavic++;
}
}
}
}
}
echo '<p><strong>Total meanings</strong> (i.e. English descriptions): '.$stats_lang_meanings_english.'</p>
<p>Number of translated meanings (synonyms):<p>';
foreach ($languagelist_alpha[1] as $rows7) {
$get_longlang = array_search($rows7,$languagelist_alpha[1]);
$query_longlang = $languagelist_alpha[0][$get_longlang];
echo '<strong>'.$query_longlang.':</strong> '.${'stats_lang_meanings2_'.$rows7}.'<br>';
}
echo '<strong>Total: '.$stats_lang_meanings_slavic.'</strong><br>';
echo '<h4>Other basic statistical functions to be implemented in future:</h4>
<ul>
<li>Number of complete false friends (+per languages)</li>
<li>Number of true friends</li>
<li>Unique meanings</li>
</ul>';
?>