r52491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52490‎ | r52491 | r52492 >
Date:14:19, 27 June 2009
Author:daniel
Status:deferred
Tags:
Comment:
avoid self-redirects
Modified paths:
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/ConceptImporter.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/ConceptImporter.java
@@ -467,7 +467,11 @@
468468 } else {
469469 out.debug("processing category redirect "+rcName+" -> "+link);
470470 storePageTerms(rcId, analyzerPage.getTitleTerms(), -1, link.getPage().toString(), ExtractionRule.TERM_FROM_REDIRECT );
471 - storeConceptAlias(rcId, conceptId, name, -1, link.getPage().toString(), AliasScope.REDIRECT);
 471+ String tgtConcept = link.getPage().toString();
 472+
 473+ if (!name.equals(tgtConcept)) {
 474+ storeConceptAlias(rcId, conceptId, name, -1, tgtConcept, AliasScope.REDIRECT);
 475+ }
472476 }
473477 } else {
474478 out.info("skipped inter-namespace redirect "+rcName+" -> "+link);

Status & tagging log