Index: trunk/WikiWord/WikiWord/src/main/php/build-search-index.sh |
— | — | @@ -1,15 +0,0 @@ |
2 | | -#!/bin/bash |
3 | | -set -e |
4 | | - |
5 | | -db="$1" |
6 | | -collection="$2" |
7 | | -thesaurus="$3" |
8 | | -languages="en de fr nl it es pt pl" |
9 | | - |
10 | | -echo "preparing search index" |
11 | | -replace '{collection}' "$collection" '{thesaurus}' "$thesaurus" < search-index.sql | mysql "$db" |
12 | | - |
13 | | -for n in $languages; do |
14 | | - echo "collection search index: $n" |
15 | | - replace '{collection}' "$collection" '{thesaurus}' "$thesaurus" '{lang}' "$n" < search-index-local.sql | mysql "$db" |
16 | | -done |
Index: trunk/WikiWord/WikiWord/src/main/php/search-index-local.sql |
— | — | @@ -1,16 +0,0 @@ |
2 | | -insert into {collection}_{thesaurus}_search_index ( |
3 | | - concept, concept_name, `type`, |
4 | | - `lang`, `term`, `score`, `norm` ) |
5 | | -select O.global_concept, M.concept_name, C.type, "{lang}", |
6 | | - REPLACE( LCASE( CAST(M.term_text as CHAR CHARACTER SET utf8) COLLATE utf8_general_ci ), "-", "" ), |
7 | | - M.rule * M.freq, 1 |
8 | | -from {collection}_{lang}_meaning as M |
9 | | -join {collection}_{thesaurus}_origin as O on O.lang = "{lang}" and O.local_concept = M.concept |
10 | | -join {collection}_{thesaurus}_concept as C on C.id = O.global_concept |
11 | | -where (M.rule not in (10, 30) OR M.freq > 1) and C.type > 0 |
12 | | -on duplicate key update |
13 | | - score = if (score > values(score), score, values(score)), |
14 | | - norm = if (norm < values(norm), score, values(norm)); |
15 | | - |
\ No newline at end of file |
Index: trunk/WikiWord/WikiWord/src/main/php/concept-info.sql |
— | — | @@ -1,20 +0,0 @@ |
2 | | -SET SESSION group_concat_max_len = 262144; -- 1024*256 |
3 | | - |
4 | | -create table if not exists {collection}_{thesaurus}_concept_info ( |
5 | | - concept int(11) NOT NULL, |
6 | | - `lang` varbinary(10) NOT NULL, |
7 | | - `name` varbinary(255) NOT NULL, |
8 | | - `pages` MEDIUMBLOB DEFAULT NULL, |
9 | | - `definition` MEDIUMBLOB DEFAULT NULL, |
10 | | - `broader` MEDIUMBLOB DEFAULT NULL, |
11 | | - `narrower` MEDIUMBLOB DEFAULT NULL, |
12 | | - `similar` MEDIUMBLOB DEFAULT NULL, |
13 | | - `related` MEDIUMBLOB DEFAULT NULL, |
14 | | - PRIMARY KEY ( concept, lang ) |
15 | | - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; |
16 | | - |
17 | | -truncate {collection}_{thesaurus}_concept_info; |
18 | | - |
19 | | -insert into {collection}_{thesaurus}_concept_info ( concept, lang, name ) |
20 | | -select global_concept, lang, local_concept_name |
21 | | -from {collection}_{thesaurus}_origin; |
Index: trunk/WikiWord/WikiWord/src/main/php/search-index.sql |
— | — | @@ -1,13 +0,0 @@ |
2 | | -create table if not exists {collection}_{thesaurus}_search_index ( |
3 | | - concept int(11) NOT NULL, |
4 | | - concept_name varbinary(255) NOT NULL, |
5 | | - type int(11) NOT NULL, |
6 | | - `lang` varbinary(10) NOT NULL, |
7 | | - `term` varchar(255) character set utf8 collate utf8_general_ci NOT NULL, |
8 | | - `score` int NOT NULL, |
9 | | - `norm` int NOT NULL, |
10 | | - PRIMARY KEY ( lang, term, concept ), |
11 | | - KEY ( concept, lang ) |
12 | | - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; |
13 | | - |
14 | | -truncate {collection}_{thesaurus}_search_index; |
Index: trunk/WikiWord/WikiWord/src/main/php/build-concept-info.sh |
— | — | @@ -1,15 +0,0 @@ |
2 | | -#!/bin/bash |
3 | | -set -e |
4 | | - |
5 | | -db="$1" |
6 | | -collection="$2" |
7 | | -thesaurus="$3" |
8 | | -languages="commons en de fr nl it es pt pl" |
9 | | - |
10 | | -echo "preparing concept info" |
11 | | -replace '{collection}' "$collection" '{thesaurus}' "$thesaurus" < concept-info.sql | mysql "$db" |
12 | | - |
13 | | -for n in $languages; do |
14 | | - echo "collection concept info: $n" |
15 | | - replace '{collection}' "$collection" '{thesaurus}' "$thesaurus" '{lang}' "$n" < concept-info-local.sql | mysql "$db" |
16 | | -done |
Index: trunk/WikiWord/WikiWord/src/main/php/concept-info-local.sql |
— | — | @@ -1,61 +0,0 @@ |
2 | | -SET SESSION group_concat_max_len = 262144; -- 1024*256 |
3 | | - |
4 | | -update {collection}_{thesaurus}_concept_info as I |
5 | | -join {collection}_{thesaurus}_origin as O on I.lang = O.lang and I.concept = O.global_concept |
6 | | -join {collection}_{lang}_definition as D on O.local_concept = D.concept and O.lang = "{lang}" |
7 | | -set I.definition = D.definition |
8 | | -where I.lang = "{lang}"; |
9 | | - |
10 | | -update {collection}_{thesaurus}_concept_info as I |
11 | | -join ( select O.global_concept as concept, O.lang as lang, |
12 | | - group_concat(distinct concat(R.type, ":", R.name) separator "|" ) as pages |
13 | | - from {collection}_{thesaurus}_origin as O |
14 | | - join {collection}_{lang}_about as A on A.concept = O.local_concept and O.lang = "{lang}" |
15 | | - join {collection}_{lang}_resource as R on R.id = A.resource |
16 | | - where O.lang = "{lang}" and R.type IN (10, 50) |
17 | | - group by O.global_concept, O.lang |
18 | | - ) as X |
19 | | -on I.concept = X.concept and I.lang = X.lang |
20 | | -set I.pages = X.pages |
21 | | -where I.lang = "{lang}"; |
22 | | - |
23 | | -update {collection}_{thesaurus}_concept_info as I |
24 | | -join ( select narrow as concept, group_concat(distinct concat(broad, ":", if (local_concept_name is null, "", local_concept_name)) separator "|") as broader |
25 | | -from {collection}_{thesaurus}_broader |
26 | | - left join {collection}_{thesaurus}_origin as O on O.global_concept = broad and O.lang = "{lang}" |
27 | | - group by narrow ) as X |
28 | | -on X.concept = I.concept and I.lang = "{lang}" |
29 | | -set I.broader = X.broader; |
30 | | - |
31 | | -update {collection}_{thesaurus}_concept_info as I |
32 | | -join ( select broad as concept, group_concat(distinct concat(narrow, ":", if (local_concept_name is null, "", local_concept_name)) separator "|") as narrower |
33 | | -from {collection}_{thesaurus}_broader |
34 | | - left join {collection}_{thesaurus}_origin as O on O.global_concept = narrow and O.lang = "{lang}" |
35 | | - group by broad ) as X |
36 | | -on X.concept = I.concept and I.lang = "{lang}" |
37 | | -set I.narrower = X.narrower; |
38 | | - |
39 | | -update {collection}_{thesaurus}_concept_info as I |
40 | | -join ( select concept1 as concept, group_concat(distinct concat(concept2, ":", if (local_concept_name is null, "", local_concept_name)) separator "|") as similar |
41 | | -from {collection}_{thesaurus}_relation |
42 | | - left join {collection}_{thesaurus}_origin as O on O.global_concept = concept2 and O.lang = "{lang}" |
43 | | - where langmatch >= 1 or langref >= 1 |
44 | | - group by concept1 ) as X |
45 | | -on X.concept = I.concept and I.lang = "{lang}" |
46 | | -set I.similar = X.similar; |
47 | | - |
48 | | -update {collection}_{thesaurus}_concept_info as I |
49 | | -join ( select concept1 as concept, group_concat(distinct concat(concept2, ":", if (local_concept_name is null, "", local_concept_name)) separator "|") as related |
50 | | -from {collection}_{thesaurus}_relation |
51 | | - left join {collection}_{thesaurus}_origin as O on O.global_concept = concept2 and O.lang = "{lang}" |
52 | | - where bilink >= 1 |
53 | | - group by concept1 ) as X |
54 | | -on X.concept = I.concept and I.lang = "{lang}" |
55 | | -set I.related = X.related; |
56 | | - |
Index: trunk/WikiWord/WikiWord/src/main/php/config.sample.php |
— | — | @@ -1,81 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -#$wwAPI = "http://wikiword.wikimedia.de/api.php"; |
5 | | -$wwAPI = false; |
6 | | -$wwAllowTranslate = false; |
7 | | -$wwImageSearch = null; //NOTE: trinary: true forces image searche, false disables it. null makes it optional. |
8 | | - |
9 | | -$wwDBServer = "localhost"; |
10 | | -$wwDBUser = "wikiword"; |
11 | | -$wwDBPassword = "xxxxxxxxxx"; |
12 | | -$wwDBDatabase = "wikiword"; |
13 | | - |
14 | | -$wwLanguages = array("en" => "Englisch", "de" => "German", "fr" => "French"); |
15 | | -$wwTablePrefix = "full"; |
16 | | -$wwThesaurusDataset = "thesaurus"; |
17 | | - |
18 | | -#error_reporting(E_ALL); |
19 | | - |
20 | | -$wwMaxPreviewImages = 5; |
21 | | -$wwMaxPreviewLinks = 20; |
22 | | -$wwGalleryColumns = 5; |
23 | | -$wwMaxGalleryImages = 200; |
24 | | -$wwMaxDetailLinks = 1000; |
25 | | -$wwThumbSize = 120; |
26 | | -$wwThumbnailURL = "http://toolserver.org/tsthumb/tsthumb?f={name}&domain=commons.wikimedia.org&w={width}&h={height}"; |
27 | | -$wwImagePageURL = "http://commons.wikimedia.org/wiki/File:{name}"; |
28 | | - |
29 | | -#$wwFakeCommonsConcepts = false; |
30 | | -#$wwFakeCommonsPlural = false; |
31 | | -$wwCommonsTablePrefix = "commonswiki_p."; |
32 | | - |
33 | | -$wwWikiInfoTable = "toolserver.wiki"; |
34 | | -$wwWikiDbName = "{lang}wiki_p"; |
35 | | -$wwWikiServerName = "sql-s{num}"; |
36 | | - |
37 | | -$wwCommonsServerName = null; |
38 | | - |
39 | | -$wwTagsTable = null; |
40 | | - |
41 | | -#$wwGilNoiceTable = null; |
42 | | -#$wwGilNoiceThreshold = 10; |
43 | | -$wwFrequentImageThreshold = 10; |
44 | | - |
45 | | -$wwTagScores = array( |
46 | | - 'Category:Featured_pictures_on_Wikimedia_Commons' => 10, |
47 | | - 'Category:Featured_pictures_on_Wikipedia,_German' => 10, |
48 | | - |
49 | | - 'Template:Former_featured_picture' => 6, |
50 | | - |
51 | | - 'Template:Media_of_the_day' => 10, |
52 | | - 'Template:Picture_of_the_day' => 10, |
53 | | - |
54 | | - 'Category:Quality_images' => 8, |
55 | | - |
56 | | - 'Category:Valued_image' => 8, |
57 | | - 'Category:Former_valued_images' => 6, |
58 | | - 'Category:Images_used_in_valued_image_sets' => 7, |
59 | | - |
60 | | - 'assessment:Media_of_the_day' => 10, |
61 | | - 'assessment:Picture_of_the_day' => 10, |
62 | | - 'assessment:Picture_of_the_week' => 15, |
63 | | - 'assessment:Picture_of_the_month' => 20, |
64 | | - 'assessment:Picture_of_the_year' => 25, |
65 | | - 'assessment:Quality_image' => 8, |
66 | | - 'assessment:Featured_picture' => 15, |
67 | | -); |
68 | | - |
69 | | - |
70 | | -$wwLabelPatterns = array( |
71 | | - '/^assessment:.*_of_the_day([-_].*|$)/' => "PotD", |
72 | | - '/^assessment:.*_of_the_week([-_].*|$)/' => "PotW", |
73 | | - '/^assessment:.*_of_the_month([-_].*|$)/' => "PotM", |
74 | | - '/^assessment:.*_of_the_year([-_].*|$)/' => "PotY", |
75 | | - '/^assessment:(Featured|Former_featured_picture).*/' => 'FP', |
76 | | - '/^assessment:Quiality.*/' => 'QI', |
77 | | - '/^assessment:(Valued|Former_valued_images|Images_used_in_valued_image_sets).*/' => 'VI', |
78 | | - '/^license:PD([-_].*|$)/' => 'PD', |
79 | | - '/^license:GFDL([-_].*|$)/' => 'GFDL', |
80 | | - '/^license:CC-BY-SA([-_].*|$)/i' => 'CC-BY-SA', |
81 | | - '/^license:CC-BY([-_].*|$)/i' => 'BY', |
82 | | -); |
\ No newline at end of file |
Index: trunk/WikiWord/WikiWordWeb/src/main/www/config.sample.php |
— | — | @@ -0,0 +1,81 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +#$wwAPI = "http://wikiword.wikimedia.de/api.php"; |
| 5 | +$wwAPI = false; |
| 6 | +$wwAllowTranslate = false; |
| 7 | +$wwImageSearch = null; //NOTE: trinary: true forces image searche, false disables it. null makes it optional. |
| 8 | + |
| 9 | +$wwDBServer = "localhost"; |
| 10 | +$wwDBUser = "wikiword"; |
| 11 | +$wwDBPassword = "xxxxxxxxxx"; |
| 12 | +$wwDBDatabase = "wikiword"; |
| 13 | + |
| 14 | +$wwLanguages = array("en" => "Englisch", "de" => "German", "fr" => "French"); |
| 15 | +$wwTablePrefix = "full"; |
| 16 | +$wwThesaurusDataset = "thesaurus"; |
| 17 | + |
| 18 | +#error_reporting(E_ALL); |
| 19 | + |
| 20 | +$wwMaxPreviewImages = 5; |
| 21 | +$wwMaxPreviewLinks = 20; |
| 22 | +$wwGalleryColumns = 5; |
| 23 | +$wwMaxGalleryImages = 200; |
| 24 | +$wwMaxDetailLinks = 1000; |
| 25 | +$wwThumbSize = 120; |
| 26 | +$wwThumbnailURL = "http://toolserver.org/tsthumb/tsthumb?f={name}&domain=commons.wikimedia.org&w={width}&h={height}"; |
| 27 | +$wwImagePageURL = "http://commons.wikimedia.org/wiki/File:{name}"; |
| 28 | + |
| 29 | +#$wwFakeCommonsConcepts = false; |
| 30 | +#$wwFakeCommonsPlural = false; |
| 31 | +$wwCommonsTablePrefix = "commonswiki_p."; |
| 32 | + |
| 33 | +$wwWikiInfoTable = "toolserver.wiki"; |
| 34 | +$wwWikiDbName = "{lang}wiki_p"; |
| 35 | +$wwWikiServerName = "sql-s{num}"; |
| 36 | + |
| 37 | +$wwCommonsServerName = null; |
| 38 | + |
| 39 | +$wwTagsTable = null; |
| 40 | + |
| 41 | +#$wwGilNoiceTable = null; |
| 42 | +#$wwGilNoiceThreshold = 10; |
| 43 | +$wwFrequentImageThreshold = 10; |
| 44 | + |
| 45 | +$wwTagScores = array( |
| 46 | + 'Category:Featured_pictures_on_Wikimedia_Commons' => 10, |
| 47 | + 'Category:Featured_pictures_on_Wikipedia,_German' => 10, |
| 48 | + |
| 49 | + 'Template:Former_featured_picture' => 6, |
| 50 | + |
| 51 | + 'Template:Media_of_the_day' => 10, |
| 52 | + 'Template:Picture_of_the_day' => 10, |
| 53 | + |
| 54 | + 'Category:Quality_images' => 8, |
| 55 | + |
| 56 | + 'Category:Valued_image' => 8, |
| 57 | + 'Category:Former_valued_images' => 6, |
| 58 | + 'Category:Images_used_in_valued_image_sets' => 7, |
| 59 | + |
| 60 | + 'assessment:Media_of_the_day' => 10, |
| 61 | + 'assessment:Picture_of_the_day' => 10, |
| 62 | + 'assessment:Picture_of_the_week' => 15, |
| 63 | + 'assessment:Picture_of_the_month' => 20, |
| 64 | + 'assessment:Picture_of_the_year' => 25, |
| 65 | + 'assessment:Quality_image' => 8, |
| 66 | + 'assessment:Featured_picture' => 15, |
| 67 | +); |
| 68 | + |
| 69 | + |
| 70 | +$wwLabelPatterns = array( |
| 71 | + '/^assessment:.*_of_the_day([-_].*|$)/' => "PotD", |
| 72 | + '/^assessment:.*_of_the_week([-_].*|$)/' => "PotW", |
| 73 | + '/^assessment:.*_of_the_month([-_].*|$)/' => "PotM", |
| 74 | + '/^assessment:.*_of_the_year([-_].*|$)/' => "PotY", |
| 75 | + '/^assessment:(Featured|Former_featured_picture).*/' => 'FP', |
| 76 | + '/^assessment:Quiality.*/' => 'QI', |
| 77 | + '/^assessment:(Valued|Former_valued_images|Images_used_in_valued_image_sets).*/' => 'VI', |
| 78 | + '/^license:PD([-_].*|$)/' => 'PD', |
| 79 | + '/^license:GFDL([-_].*|$)/' => 'GFDL', |
| 80 | + '/^license:CC-BY-SA([-_].*|$)/i' => 'CC-BY-SA', |
| 81 | + '/^license:CC-BY([-_].*|$)/i' => 'BY', |
| 82 | +); |
\ No newline at end of file |