Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/ArticlesParser.java |
— | — | @@ -12,8 +12,21 @@ |
13 | 13 | |
14 | 14 | |
15 | 15 | /** |
| 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 | + * |
16 | 27 | * @author rainman |
17 | 28 | * |
| 29 | + * used exclusively in tests |
| 30 | + * |
18 | 31 | */ |
19 | 32 | public class ArticlesParser { |
20 | 33 | |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/ranks/ContextParserTest.java |
— | — | @@ -3,12 +3,18 @@ |
4 | 4 | import org.wikimedia.lsearch.analyzers.ArticlesParser; |
5 | 5 | import org.wikimedia.lsearch.analyzers.FastWikiTokenizerEngine; |
6 | 6 | import org.wikimedia.lsearch.analyzers.TestArticle; |
7 | | -import org.wikimedia.lsearch.ranks.ContextParser; |
8 | 7 | |
9 | 8 | public class ContextParserTest { |
10 | 9 | |
| 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 | + */ |
11 | 17 | 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"); |
13 | 19 | for(TestArticle a : ap.getArticles()){ |
14 | 20 | ContextParser p = new ContextParser(a.content,null,null,null); |
15 | 21 | System.out.println("ORIGINAL ARTICLE:"); |