Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/analyzer/WikiTextAnalyzerTest.java |
— | — | @@ -15,7 +15,13 @@ |
16 | 16 | import de.brightbyte.wikiword.Corpus; |
17 | 17 | import de.brightbyte.wikiword.Namespace; |
18 | 18 | import de.brightbyte.wikiword.ResourceType; |
19 | | -import de.brightbyte.wikiword.analyzer.TemplateExtractor.TemplateData; |
| 19 | +import de.brightbyte.wikiword.analyzer.mangler.Armorer; |
| 20 | +import de.brightbyte.wikiword.analyzer.mangler.TextArmor; |
| 21 | +import de.brightbyte.wikiword.analyzer.sensor.HasCategoryLikeSensor; |
| 22 | +import de.brightbyte.wikiword.analyzer.sensor.HasSectionSensor; |
| 23 | +import de.brightbyte.wikiword.analyzer.sensor.HasTemplateSensor; |
| 24 | +import de.brightbyte.wikiword.analyzer.sensor.TitleSensor; |
| 25 | +import de.brightbyte.wikiword.analyzer.template.TemplateExtractor.TemplateData; |
20 | 26 | |
21 | 27 | /** |
22 | 28 | * Unit tests for WikiTextAnalyzer |
— | — | @@ -41,19 +47,19 @@ |
42 | 48 | |
43 | 49 | public void testUnarmor() { |
44 | 50 | TextArmor armor = new TextArmor(); |
45 | | - armor.put(AbstractAnalyzer.ARMOR_MARKER_CHAR+"[1]", "one"); |
46 | | - armor.put(AbstractAnalyzer.ARMOR_MARKER_CHAR+"[2]", "two"); |
47 | | - armor.put(AbstractAnalyzer.ARMOR_MARKER_CHAR+"[3]", "three"); |
| 51 | + armor.put(Armorer.ARMOR_MARKER_CHAR+"[1]", "one"); |
| 52 | + armor.put(Armorer.ARMOR_MARKER_CHAR+"[2]", "two"); |
| 53 | + armor.put(Armorer.ARMOR_MARKER_CHAR+"[3]", "three"); |
48 | 54 | |
49 | | - CharSequence s = armor.unarmor("and "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[1] and "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[2] and "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[3] and "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[4]!"); |
50 | | - assertEquals("simple unarmor", "and one and two and three and "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[4]!", s.toString()); |
| 55 | + CharSequence s = armor.unarmor("and "+Armorer.ARMOR_MARKER_CHAR+"[1] and "+Armorer.ARMOR_MARKER_CHAR+"[2] and "+Armorer.ARMOR_MARKER_CHAR+"[3] and "+Armorer.ARMOR_MARKER_CHAR+"[4]!"); |
| 56 | + assertEquals("simple unarmor", "and one and two and three and "+Armorer.ARMOR_MARKER_CHAR+"[4]!", s.toString()); |
51 | 57 | |
52 | 58 | armor = new TextArmor(); |
53 | | - armor.put(""+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[1]", "foo"); |
54 | | - armor.put(""+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[2]", "bar"); |
55 | | - armor.put(""+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[3]", ""+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[1]"+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[2]"); |
| 59 | + armor.put(""+Armorer.ARMOR_MARKER_CHAR+"[1]", "foo"); |
| 60 | + armor.put(""+Armorer.ARMOR_MARKER_CHAR+"[2]", "bar"); |
| 61 | + armor.put(""+Armorer.ARMOR_MARKER_CHAR+"[3]", ""+Armorer.ARMOR_MARKER_CHAR+"[1]"+Armorer.ARMOR_MARKER_CHAR+"[2]"); |
56 | 62 | |
57 | | - s = armor.unarmor("it's "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[1], "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[2], and "+AbstractAnalyzer.ARMOR_MARKER_CHAR+"[3]!"); |
| 63 | + s = armor.unarmor("it's "+Armorer.ARMOR_MARKER_CHAR+"[1], "+Armorer.ARMOR_MARKER_CHAR+"[2], and "+Armorer.ARMOR_MARKER_CHAR+"[3]!"); |
58 | 64 | assertEquals("nested unarmor", "it's foo, bar, and foobar!", s.toString()); |
59 | 65 | } |
60 | 66 | |
— | — | @@ -647,16 +653,16 @@ |
648 | 654 | language.initialize(); |
649 | 655 | |
650 | 656 | WikiConfiguration config = new WikiConfiguration(); |
651 | | - config.resourceTypeSensors.add( new WikiTextAnalyzer.TitleSensor(ResourceType.DISAMBIG, ".*_\\(Disambiguation\\)", 0) ); |
652 | | - config.resourceTypeSensors.add( new WikiTextAnalyzer.HasTemplateSensor(ResourceType.DISAMBIG, "Disambiguation", null) ); |
653 | | - config.resourceTypeSensors.add( new WikiTextAnalyzer.HasTemplateSensor(ResourceType.BAD, "Delete", null) ); |
| 657 | + config.resourceTypeSensors.add( new TitleSensor(ResourceType.DISAMBIG, ".*_\\(Disambiguation\\)", 0) ); |
| 658 | + config.resourceTypeSensors.add( new HasTemplateSensor(ResourceType.DISAMBIG, "Disambiguation", null) ); |
| 659 | + config.resourceTypeSensors.add( new HasTemplateSensor(ResourceType.BAD, "Delete", null) ); |
654 | 660 | |
655 | | - config.conceptTypeSensors.add( new WikiTextAnalyzer.HasCategoryLikeSensor(ConceptType.PERSON, "^Died_|^Born_", 0) ); |
656 | | - config.conceptTypeSensors.add( new WikiTextAnalyzer.HasCategoryLikeSensor(ConceptType.NAME, "(^N|_n)ames?$", 0) ); |
657 | | - config.conceptTypeSensors.add( new WikiTextAnalyzer.HasCategoryLikeSensor(ConceptType.PLACE, "^Town_in_|^Country_in_|^Region_in_", 0) ); |
658 | | - config.conceptTypeSensors.add( new WikiTextAnalyzer.HasTemplateSensor(ConceptType.LIFEFORM, "Taxobox", null) ); |
659 | | - config.conceptTypeSensors.add( new WikiTextAnalyzer.TitleSensor(ConceptType.TIME, "-?\\d+", 0) ); |
660 | | - config.conceptTypeSensors.add( new WikiTextAnalyzer.HasSectionSensor(ConceptType.PERSON, "Life") ); |
| 661 | + config.conceptTypeSensors.add( new HasCategoryLikeSensor(ConceptType.PERSON, "^Died_|^Born_", 0) ); |
| 662 | + config.conceptTypeSensors.add( new HasCategoryLikeSensor(ConceptType.NAME, "(^N|_n)ames?$", 0) ); |
| 663 | + config.conceptTypeSensors.add( new HasCategoryLikeSensor(ConceptType.PLACE, "^Town_in_|^Country_in_|^Region_in_", 0) ); |
| 664 | + config.conceptTypeSensors.add( new HasTemplateSensor(ConceptType.LIFEFORM, "Taxobox", null) ); |
| 665 | + config.conceptTypeSensors.add( new TitleSensor(ConceptType.TIME, "-?\\d+", 0) ); |
| 666 | + config.conceptTypeSensors.add( new HasSectionSensor(ConceptType.PERSON, "Life") ); |
661 | 667 | |
662 | 668 | config.disambigStripSectionPattern = WikiConfiguration.sectionPattern("see also|external links", Pattern.CASE_INSENSITIVE); |
663 | 669 | |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/analyzer/WikiTextAnalyzerBenchmark.java |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | |
35 | 35 | long t = System.currentTimeMillis(); |
36 | 36 | for (int i = 0; i<count; i++) { |
37 | | - WikiTextAnalyzer.WikiPage page = analyzer.makePage(0, file, text, false); |
| 37 | + WikiPage page = analyzer.makePage(0, file, text, false); |
38 | 38 | page.getResourceType(); |
39 | 39 | page.getConceptType(); |
40 | 40 | page.getCleanedText(true); |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/analyzer/WikiTextAnalyzerTestBase.java |
— | — | @@ -55,12 +55,12 @@ |
56 | 56 | } |
57 | 57 | |
58 | 58 | protected void assertTestCase(String title, String property, Object value) throws Throwable { |
59 | | - WikiTextAnalyzer.WikiPage page = makeTestPage(title); |
| 59 | + WikiPage page = makeTestPage(title); |
60 | 60 | assertTestCase(page, property, value); |
61 | 61 | } |
62 | 62 | |
63 | 63 | protected void assertTestCase(String title, Map<String, Object> values) throws Throwable { |
64 | | - WikiTextAnalyzer.WikiPage page = makeTestPage(title); |
| 64 | + WikiPage page = makeTestPage(title); |
65 | 65 | assertTestCase(page, values); |
66 | 66 | } |
67 | 67 | |
— | — | @@ -87,22 +87,22 @@ |
88 | 88 | return text.toString(); |
89 | 89 | } |
90 | 90 | |
91 | | - protected WikiTextAnalyzer.WikiPage makeTestPage(String title) throws IOException { |
| 91 | + protected WikiPage makeTestPage(String title) throws IOException { |
92 | 92 | String text = loadTestPage(title, getClass(), corpus); |
93 | 93 | return makeTestPage(0, title, text); |
94 | 94 | } |
95 | 95 | |
96 | | - protected WikiTextAnalyzer.WikiPage makeTestPage(int namespace, String title, String text) { |
97 | | - WikiTextAnalyzer.WikiPage page = analyzer.makePage(namespace, title, text, false); |
| 96 | + protected WikiPage makeTestPage(int namespace, String title, String text) { |
| 97 | + WikiPage page = analyzer.makePage(namespace, title, text, false); |
98 | 98 | return page; |
99 | 99 | } |
100 | 100 | |
101 | 101 | protected void assertTestCase(int namespace, String title, String text, Map<String, Object> values) throws Throwable { |
102 | | - WikiTextAnalyzer.WikiPage page = makeTestPage(namespace, title, text); |
| 102 | + WikiPage page = makeTestPage(namespace, title, text); |
103 | 103 | assertTestCase(page, values); |
104 | 104 | } |
105 | 105 | |
106 | | - protected void assertTestCase(WikiTextAnalyzer.WikiPage page, String property, Object expected) throws Throwable { |
| 106 | + protected void assertTestCase(WikiPage page, String property, Object expected) throws Throwable { |
107 | 107 | BeanInfo info = Introspector.getBeanInfo(page.getClass()); |
108 | 108 | PropertyDescriptor p = null; |
109 | 109 | for (PropertyDescriptor prop: info.getPropertyDescriptors()) { |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | assertTestCase(page, p, expected); |
118 | 118 | } |
119 | 119 | |
120 | | - protected void assertTestCase(WikiTextAnalyzer.WikiPage page, PropertyDescriptor p, Object expected) throws Throwable { |
| 120 | + protected void assertTestCase(WikiPage page, PropertyDescriptor p, Object expected) throws Throwable { |
121 | 121 | Object actual = getPropertyValue(page, p); |
122 | 122 | |
123 | 123 | if (expected instanceof String && !(actual instanceof String) && actual instanceof CharSequence) actual = actual.toString(); |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | else assertEquals(p.getName(), expected, actual); |
129 | 129 | } |
130 | 130 | |
131 | | - protected void assertTestCase(WikiTextAnalyzer.WikiPage page, Map<String, Object> values) throws Throwable { |
| 131 | + protected void assertTestCase(WikiPage page, Map<String, Object> values) throws Throwable { |
132 | 132 | BeanInfo info = Introspector.getBeanInfo(page.getClass()); |
133 | 133 | Map<String, PropertyDescriptor> props = new HashMap<String, PropertyDescriptor>(); |
134 | 134 | for (PropertyDescriptor p: info.getPropertyDescriptors()) { |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/builder/PropertyDump.java |
— | — | @@ -12,9 +12,8 @@ |
13 | 13 | import de.brightbyte.wikiword.Namespace; |
14 | 14 | import de.brightbyte.wikiword.NamespaceSet; |
15 | 15 | import de.brightbyte.wikiword.TweakSet; |
| 16 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
16 | 17 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
17 | | -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer.WikiLink; |
18 | | -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer.WikiPage; |
19 | 18 | |
20 | 19 | |
21 | 20 | public class PropertyDump { |
— | — | @@ -45,7 +44,7 @@ |
46 | 45 | NamespaceSet namespaces = Namespace.getNamespaces(null); |
47 | 46 | analyzer.initialize(namespaces, true); |
48 | 47 | |
49 | | - WikiLink t = analyzer.makeLink(p, p, null, null); |
| 48 | + WikiTextAnalyzer.WikiLink t = analyzer.makeLink(p, p, null, null); |
50 | 49 | |
51 | 50 | WikiPage page = analyzer.makePage(t.getNamespace(), t.getTarget().toString(), text, true); |
52 | 51 | |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/wikis/WikiTextAnalyzer_ndswiki_Test.java |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | import de.brightbyte.wikiword.ConceptType; |
5 | 5 | import de.brightbyte.wikiword.ResourceType; |
6 | | -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
| 6 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
7 | 7 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzerTestBase; |
8 | 8 | |
9 | 9 | |
— | — | @@ -13,12 +13,12 @@ |
14 | 14 | } |
15 | 15 | |
16 | 16 | public void testCase_Aachen() throws Throwable { |
17 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Aachen"); |
| 17 | + WikiPage page = makeTestPage("Aachen"); |
18 | 18 | assertTestCase(page, "resourceType", ResourceType.REDIRECT); |
19 | 19 | } |
20 | 20 | |
21 | 21 | public void testCase_Belgien() throws Throwable { |
22 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Belgien"); |
| 22 | + WikiPage page = makeTestPage("Belgien"); |
23 | 23 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
24 | 24 | assertTestCase(page, "conceptType", ConceptType.PLACE); |
25 | 25 | |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/wikis/WikiTextAnalyzer_dewiki_Test.java |
— | — | @@ -1,18 +1,17 @@ |
2 | 2 | package de.brightbyte.wikiword.wikis; |
3 | 3 | |
4 | 4 | import java.util.ArrayList; |
5 | | -import java.util.HashMap; |
6 | 5 | import java.util.HashSet; |
7 | 6 | import java.util.List; |
8 | | -import java.util.Map; |
9 | 7 | import java.util.Set; |
10 | 8 | |
11 | 9 | import de.brightbyte.data.MultiMap; |
12 | 10 | import de.brightbyte.wikiword.ConceptType; |
13 | 11 | import de.brightbyte.wikiword.ResourceType; |
| 12 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
14 | 13 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
15 | 14 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzerTestBase; |
16 | | -import de.brightbyte.wikiword.analyzer.TemplateExtractor.TemplateData; |
| 15 | +import de.brightbyte.wikiword.analyzer.template.TemplateExtractor.TemplateData; |
17 | 16 | |
18 | 17 | |
19 | 18 | public class WikiTextAnalyzer_dewiki_Test extends WikiTextAnalyzerTestBase { |
— | — | @@ -22,7 +21,7 @@ |
23 | 22 | } |
24 | 23 | |
25 | 24 | public void testCase_Mont_Blanc() throws Throwable { |
26 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Mont_Blanc"); |
| 25 | + WikiPage page = makeTestPage("Mont_Blanc"); |
27 | 26 | |
28 | 27 | assertTestCase(page, "resourceType", ResourceType.REDIRECT); |
29 | 28 | |
— | — | @@ -33,7 +32,7 @@ |
34 | 33 | public void testCase_Kilauea() throws Throwable { |
35 | 34 | String definition = "K\u012blauea ist ein aktiver Schildvulkan auf den Hawai\u02bbi-Inseln und einer der f\u00fcnf Vulkane, die zusammen die Hauptinsel Hawai\u02bbi bilden."; |
36 | 35 | |
37 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Kilauea"); |
| 36 | + WikiPage page = makeTestPage("Kilauea"); |
38 | 37 | assertTestCase(page, "firstSentence", definition); |
39 | 38 | |
40 | 39 | Set<String> categories = new HashSet<String>(); |
— | — | @@ -69,7 +68,7 @@ |
70 | 69 | public void testCase_Herrenhausen_Stoecken() throws Throwable { |
71 | 70 | String definition = "Herrenhausen-Stöcken ist der 12. Stadtbezirk in Hannover."; |
72 | 71 | |
73 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Herrenhausen-Stoecken"); |
| 72 | + WikiPage page = makeTestPage("Herrenhausen-Stoecken"); |
74 | 73 | assertTestCase(page, "firstSentence", definition); |
75 | 74 | |
76 | 75 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
— | — | @@ -81,7 +80,7 @@ |
82 | 81 | public void testCase_Hofstetten_Gruenau() throws Throwable { |
83 | 82 | String definition = "Hofstetten-Grünau ist eine Marktgemeinde mit 2.622 Einwohnern im Bezirk Sankt Pölten-Land in Niederösterreich."; |
84 | 83 | |
85 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Hofstetten-Gruenau"); |
| 84 | + WikiPage page = makeTestPage("Hofstetten-Gruenau"); |
86 | 85 | assertTestCase(page, "firstSentence", definition); |
87 | 86 | |
88 | 87 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/wikis/WikiTextAnalyzer_simplewiki_Test.java |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | import de.brightbyte.wikiword.ConceptType; |
5 | 5 | import de.brightbyte.wikiword.ResourceType; |
6 | | -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
| 6 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
7 | 7 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzerTestBase; |
8 | 8 | |
9 | 9 | public class WikiTextAnalyzer_simplewiki_Test extends WikiTextAnalyzerTestBase { |
— | — | @@ -12,12 +12,12 @@ |
13 | 13 | } |
14 | 14 | |
15 | 15 | public void testCase_Bending() throws Throwable { |
16 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Bending_(disambiguation)"); |
| 16 | + WikiPage page = makeTestPage("Bending_(disambiguation)"); |
17 | 17 | assertTestCase(page, "resourceType", ResourceType.DISAMBIG); |
18 | 18 | } |
19 | 19 | |
20 | 20 | public void testCase_Dinosaur() throws Throwable { |
21 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Dinosaur"); |
| 21 | + WikiPage page = makeTestPage("Dinosaur"); |
22 | 22 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
23 | 23 | assertTestCase(page, "conceptType", ConceptType.LIFEFORM); |
24 | 24 | |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | } |
28 | 28 | |
29 | 29 | public void testCase_Peanuts() throws Throwable { |
30 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Peanuts"); |
| 30 | + WikiPage page = makeTestPage("Peanuts"); |
31 | 31 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
32 | 32 | assertTestCase(page, "conceptType", ConceptType.OTHER); |
33 | 33 | |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | } |
37 | 37 | |
38 | 38 | public void testCase_Kielce() throws Throwable { |
39 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Kielce"); |
| 39 | + WikiPage page = makeTestPage("Kielce"); |
40 | 40 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
41 | 41 | assertTestCase(page, "conceptType", ConceptType.PLACE); |
42 | 42 | |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | } |
46 | 46 | |
47 | 47 | public void testCase_Stuttgart() throws Throwable { |
48 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Stuttgart"); |
| 48 | + WikiPage page = makeTestPage("Stuttgart"); |
49 | 49 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
50 | 50 | assertTestCase(page, "conceptType", ConceptType.PLACE); |
51 | 51 | |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | } |
55 | 55 | |
56 | 56 | public void testCase_Aarhus() throws Throwable { |
57 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Aarhus"); |
| 57 | + WikiPage page = makeTestPage("Aarhus"); |
58 | 58 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
59 | 59 | assertTestCase(page, "conceptType", ConceptType.PLACE); |
60 | 60 | |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/wikis/WikiTextAnalyzer_yywiki_Test.java |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | import de.brightbyte.wikiword.ConceptType; |
10 | 10 | import de.brightbyte.wikiword.Namespace; |
11 | 11 | import de.brightbyte.wikiword.ResourceType; |
| 12 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
12 | 13 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
13 | 14 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzerTestBase; |
14 | 15 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer.LinkMagic; |
— | — | @@ -22,7 +23,7 @@ |
23 | 24 | public void testCase_Yoo() throws Throwable { |
24 | 25 | String definition = "Yoo is yoo."; |
25 | 26 | |
26 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Yoo"); |
| 27 | + WikiPage page = makeTestPage("Yoo"); |
27 | 28 | assertTestCase(page, "firstSentence", definition); |
28 | 29 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
29 | 30 | assertTestCase(page, "conceptType", ConceptType.OTHER); |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/wikis/WikiTextAnalyzer_enwiki_Test.java |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | |
7 | 7 | import de.brightbyte.wikiword.ConceptType; |
8 | 8 | import de.brightbyte.wikiword.ResourceType; |
9 | | -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
| 9 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
10 | 10 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzerTestBase; |
11 | 11 | |
12 | 12 | |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | public void testCase_Hill() throws Throwable { |
20 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Hill"); |
| 20 | + WikiPage page = makeTestPage("Hill"); |
21 | 21 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
22 | 22 | assertTestCase(page, "conceptType", ConceptType.OTHER); |
23 | 23 | assertTestCase(page, "firstSentence", "A hill is a landform that extends above the surrounding terrain, in a limited area."); |
Index: trunk/WikiWord/WikiWordBuilder/src/test/java/de/brightbyte/wikiword/wikis/WikiTextAnalyzer_nlwiki_Test.java |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | |
7 | 7 | import de.brightbyte.wikiword.ConceptType; |
8 | 8 | import de.brightbyte.wikiword.ResourceType; |
9 | | -import de.brightbyte.wikiword.analyzer.WikiTextAnalyzer; |
| 9 | +import de.brightbyte.wikiword.analyzer.WikiPage; |
10 | 10 | import de.brightbyte.wikiword.analyzer.WikiTextAnalyzerTestBase; |
11 | 11 | |
12 | 12 | |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | public void testCase_Verenigde_Staten() throws Throwable { |
20 | 20 | String definition = "De Verenigde Staten van Amerika, afgekort VS, zijn een federatie van 50 Noord-Amerikaanse staten en het district van Columbia."; |
21 | 21 | |
22 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Verenigde_Staten"); |
| 22 | + WikiPage page = makeTestPage("Verenigde_Staten"); |
23 | 23 | assertTestCase(page, "firstSentence", definition); |
24 | 24 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
25 | 25 | assertTestCase(page, "conceptType", ConceptType.PLACE); |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | public void testCase_Mikolajki() throws Throwable { |
35 | 35 | String definition = "Miko\u0142ajki is een stad in het Poolse woiwodschap Ermland-Mazuri\u00eb, gelegen in de powiat Mr\u0105gowski."; |
36 | 36 | |
37 | | - WikiTextAnalyzer.WikiPage page = makeTestPage("Mikolajki"); |
| 37 | + WikiPage page = makeTestPage("Mikolajki"); |
38 | 38 | assertTestCase(page, "firstSentence", definition); |
39 | 39 | assertTestCase(page, "resourceType", ResourceType.ARTICLE); |
40 | 40 | assertTestCase(page, "conceptType", ConceptType.PLACE); |