r46388 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46387‎ | r46388 | r46389 >
Date:21:15, 27 January 2009
Author:daniel
Status:deferred
Tags:
Comment:
convert {{commons|foo}} to [[commons:foo]]
Modified paths:
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/wikis/WikiConfiguration_dewiki.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/wikis/WikiConfiguration_enwiki.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/wikis/WikiConfiguration_frwiki.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/wikis/WikiConfiguration_enwiki.java
@@ -64,6 +64,12 @@
6565 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler("^"+templatePatternString("wrapper", 0, true), "{|", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE));
6666 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler("^"+templatePatternString("end|col-end", 0, true), "|}", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE));
6767
 68+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("commons(-inline|[ _]left|show\\d)?", 1, true), "[[commons:$1]]"));
 69+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("commons[ _+]?cat(-inline|[ _]left|show\\d)?", 1, true), "[[commons:Category:$1]]"));
 70+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("wikimedia", 1, true), "[[commons:$1]]")); //FIXME: named params: commons=
 71+ //FIXME: Commonscat-N, Commons_cat_multi...
 72+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler("\\[\\[:commons:", "[[commons:", Pattern.CASE_INSENSITIVE));
 73+
6874 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("Okina", 0, false), "\u02BB"));
6975 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("\u00b7|moddot|dot", 0, false), "\u00b7"));
7076 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("spaces", 1, true), " "));
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/wikis/WikiConfiguration_frwiki.java
@@ -7,12 +7,15 @@
88 import de.brightbyte.wikiword.ResourceType;
99 import de.brightbyte.wikiword.analyzer.WikiConfiguration;
1010 import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer;
11 -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer.NameMatcher;
1211
1312 public class WikiConfiguration_frwiki extends WikiConfiguration {
1413
1514 public WikiConfiguration_frwiki() {
1615 super();
 16+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("commons", 1, true), "[[commons:$1]]"));
 17+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("commons[ _]?cat?", 1, true), "[[commons:Category:$1]]"));
 18+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("Autres[ _]projets", 1, true), "[[commons:$1]]")); //FIXME: named params: commons=
 19+
1720 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("er?|\u00e8?re|(?:mini[ _])?[IVXCM]+(?:e|re|er)?|\\d+r?er?|Mlle|Mme|elle", 0, true), "$1"));
1821 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("romain|rom|rom-min|rom-maj|APIb|IPA", 1, true), "$2"));
1922 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("avjc", 0, false), "av. J.-C."));
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/wikis/WikiConfiguration_dewiki.java
@@ -1,5 +1,7 @@
22 package de.brightbyte.wikiword.wikis;
33
 4+import java.util.regex.Pattern;
 5+
46 import de.brightbyte.wikiword.ConceptType;
57 import de.brightbyte.wikiword.ResourceType;
68 import de.brightbyte.wikiword.analyzer.WikiConfiguration;
@@ -26,9 +28,13 @@
2729 ")\\s*\\|(?:\\s*rtl\\s*\\|)?.*?\\|\\s*(.*?)\\s*\\}\\}", "$1", Pattern.DOTALL | Pattern.CASE_INSENSITIVE));
2830 */
2931
 32+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("commons", 1, true), "[[commons:$1]]"));
 33+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("commonscat", 1, true), "[[commons:Category:$1]]"));
 34+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler("\\[\\[:commons:", "[[commons:", Pattern.CASE_INSENSITIVE));
 35+
3036 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("Okina", 0, false), "\u02BB"));
3137 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("IPA(?:-Text)|IAST|Unicode|Musik", 1, true), "$2"));
32 - stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("SWD|Commons|Wiktionary", 0, true), ""));
 38+ stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("SWD|Wiktionary", 0, true), ""));
3339
3440 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("en|it|fr|ar|Polytonisch", 1, true), "$2"));
3541 stripClutterManglers.add( new WikiTextAnalyzer.RegularExpressionMangler(templatePattern("lang", 2, true), "$3"));

Status & tagging log