r110997 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110996‎ | r110997 | r110998 >
Date:00:56, 9 February 2012
Author:oren
Status:deferred
Tags:
Comment:
fixed test and added documentation
Modified paths:
  • /trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/ArticlesParser.java (modified) (history)
  • /trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/ranks/ContextParserTest.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/ArticlesParser.java
@@ -12,8 +12,21 @@
1313
1414
1515 /**
 16+ * Load articles stored in a single file into memory
 17+ *
 18+ * the format of the file is
 19+ * <code>
 20+ * ### namespace = 0
 21+ * ### title = 1991
 22+ * ### content
 23+ *
 24+ * article content
 25+ * </code>
 26+ *
1627 * @author rainman
1728 *
 29+ * used exclusively in tests
 30+ *
1831 */
1932 public class ArticlesParser {
2033
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/ranks/ContextParserTest.java
@@ -3,12 +3,18 @@
44 import org.wikimedia.lsearch.analyzers.ArticlesParser;
55 import org.wikimedia.lsearch.analyzers.FastWikiTokenizerEngine;
66 import org.wikimedia.lsearch.analyzers.TestArticle;
7 -import org.wikimedia.lsearch.ranks.ContextParser;
87
98 public class ContextParserTest {
109
 10+ /**
 11+ * gets articles stored in the test file using ArticlesParse
 12+ * these are parsed by ContextParser which uses the containing
 13+ * sentence as the context of the link.
 14+ *
 15+ * @param args - ignored
 16+ */
1117 public static void main(String[] args){
12 - ArticlesParser ap = new ArticlesParser("./test-data/indexing-articles.test");
 18+ ArticlesParser ap = new ArticlesParser("./src/test/resources/indexing-articles.test");
1319 for(TestArticle a : ap.getArticles()){
1420 ContextParser p = new ContextParser(a.content,null,null,null);
1521 System.out.println("ORIGINAL ARTICLE:");

Status & tagging log