Index: trunk/WikiWord/WikiWordBuilder/src/main/assembly/bin-dep.xml |
— | — | @@ -35,6 +35,10 @@ |
36 | 36 | <include>*.jar</include> |
37 | 37 | </includes> |
38 | 38 | </fileSet>--> |
| 39 | + <fileSet> |
| 40 | + <directory>lib</directory> |
| 41 | + <outputDirectory>/lib</outputDirectory> |
| 42 | + </fileSet> |
39 | 43 | </fileSets> |
40 | 44 | <dependencySets> |
41 | 45 | <dependencySet> |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/processor/TitleSetFilter.java |
— | — | @@ -4,29 +4,28 @@ |
5 | 5 | import java.io.FileInputStream; |
6 | 6 | import java.io.IOException; |
7 | 7 | import java.io.InputStream; |
| 8 | +import java.util.Map; |
8 | 9 | import java.util.Set; |
9 | 10 | |
10 | | -import org.ardverk.collection.PatriciaTrie; |
11 | | -import org.ardverk.collection.StringKeyAnalyzer; |
12 | | - |
13 | 11 | import de.brightbyte.data.cursor.DataCursor; |
14 | 12 | import de.brightbyte.data.filter.StaticSetFilter; |
15 | 13 | import de.brightbyte.io.LineCursor; |
16 | 14 | import de.brightbyte.util.PersistenceException; |
| 15 | +import de.brightbyte.wikiword.builder.NameMaps; |
17 | 16 | |
18 | 17 | public class TitleSetFilter extends PageTitleFilter { |
19 | 18 | |
20 | 19 | protected static Set<String> slurpCursor(DataCursor<String> titleCursor) throws PersistenceException { |
21 | | - PatriciaTrie<String, Integer> trie = new PatriciaTrie<String, Integer>(new StringKeyAnalyzer()); |
| 20 | + Map<String, Integer> map = NameMaps.newMap(); |
22 | 21 | |
23 | 22 | final Integer ONE = new Integer(1); |
24 | 23 | |
25 | 24 | String s; |
26 | 25 | while ((s = titleCursor.next()) != null) { |
27 | | - trie.put(s, ONE); |
| 26 | + map.put(s, ONE); |
28 | 27 | } |
29 | 28 | |
30 | | - return trie.keySet(); |
| 29 | + return map.keySet(); |
31 | 30 | } |
32 | 31 | |
33 | 32 | protected static Set<String> slurpLines(File f, String enc) throws PersistenceException { |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/NameMaps.java |
— | — | @@ -0,0 +1,20 @@ |
| 2 | +package de.brightbyte.wikiword.builder; |
| 3 | + |
| 4 | +import java.util.HashMap; |
| 5 | +import java.util.Map; |
| 6 | + |
| 7 | +import org.ardverk.collection.PatriciaTrie; |
| 8 | +import org.ardverk.collection.StringKeyAnalyzer; |
| 9 | + |
| 10 | +public class NameMaps { |
| 11 | + public static <V> Map<String, V> newMap() { |
| 12 | + try { |
| 13 | + PatriciaTrie<String, V> trie = new PatriciaTrie<String, V>(new StringKeyAnalyzer()); |
| 14 | + return trie; |
| 15 | + } catch (LinkageError ex) { |
| 16 | + //noop |
| 17 | + } |
| 18 | + |
| 19 | + return new HashMap<String, V>(); |
| 20 | + } |
| 21 | +} |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | import java.sql.ResultSet; |
9 | 9 | import java.sql.SQLException; |
10 | 10 | import java.util.Date; |
| 11 | +import java.util.Map; |
11 | 12 | import java.util.Random; |
12 | 13 | |
13 | 14 | import javax.sql.DataSource; |
— | — | @@ -33,6 +34,7 @@ |
34 | 35 | import de.brightbyte.wikiword.ExtractionRule; |
35 | 36 | import de.brightbyte.wikiword.ResourceType; |
36 | 37 | import de.brightbyte.wikiword.TweakSet; |
| 38 | +import de.brightbyte.wikiword.builder.NameMaps; |
37 | 39 | import de.brightbyte.wikiword.model.LocalConcept; |
38 | 40 | import de.brightbyte.wikiword.model.LocalConceptReference; |
39 | 41 | import de.brightbyte.wikiword.schema.AliasScope; |
— | — | @@ -153,8 +155,8 @@ |
154 | 156 | |
155 | 157 | int bsz = tweaks.getTweak("dbstore.idManager.bufferSize", 16*1024); |
156 | 158 | |
157 | | - //FIXME: use factory to create map impl! |
158 | | - idManager = new PersistentIdManager(new PatriciaTrie<String, Integer>(new StringKeyAnalyzer()), f, "UTF-8", bsz); |
| 159 | + Map<String, Integer> map = NameMaps.newMap(); |
| 160 | + idManager = new PersistentIdManager(map, f, "UTF-8", bsz); |
159 | 161 | } |
160 | 162 | |
161 | 163 | /* |