Changeset 6065 for SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java
- Timestamp:
- 02/26/15 16:17:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java
r6057 r6065 18 18 import eu.clarin.sru.fcs.aggregator.rest.RestService; 19 19 import eu.clarin.sru.fcs.aggregator.scan.Statistics; 20 import eu.clarin.sru.fcs.aggregator. lang.LanguagesISO693_3;20 import eu.clarin.sru.fcs.aggregator.util.LanguagesISO693; 21 21 import io.dropwizard.Application; 22 22 import io.dropwizard.assets.AssetsBundle; … … 25 25 import java.io.File; 26 26 import java.io.IOException; 27 import java.io.InputStream;28 27 import java.util.ArrayList; 29 28 import java.util.Collections; … … 35 34 import java.util.concurrent.ScheduledExecutorService; 36 35 import java.util.concurrent.atomic.AtomicReference; 37 import opennlp.tools.tokenize.TokenizerModel;38 36 import org.slf4j.LoggerFactory; 39 37 … … 88 86 * @author edima 89 87 * 88 * TODO: ?use weblicht only to show up in zoomed mode 89 * - send only tcf with only a text layer and language (from the list in params) 90 * 91 * TODO: add the modes described above (except live) 92 * 90 93 * TODO: zoom into the results from a corpus, allow functionality only for 91 94 * the view (search for next set of results) … … 95 98 * Twan (they did a test, it worked) 96 99 * 100 * TODO: add PiWik support, tracking the following: 101 * - visits, searches, search per corpus 102 * 103 * TODO: BUG: language detection is immediate, in UI; export implications 104 * 97 105 * TODO: websockets 98 106 * … … 122 130 private AtomicReference<Statistics> searchStatsAtom = new AtomicReference<Statistics>(new Statistics()); 123 131 124 private TokenizerModel tokenizerModel;125 132 private LanguageDetector languageDetector; 126 133 private TextObjectFactory textObjectFactory; … … 235 242 } 236 243 237 LanguagesISO693_3.getInstance(); // force init 238 initTokenizer(); 244 LanguagesISO693.getInstance(); // force init 239 245 initLanguageDetector(); 240 246 … … 293 299 } 294 300 295 public TokenizerModel getTokenizerModel() {296 return tokenizerModel;297 }298 299 301 private static void shutdownAndAwaitTermination(AggregatorConfiguration.Params params, 300 302 ThrottledClient sruClient, ExecutorService scheduler) { … … 313 315 } 314 316 315 private void initTokenizer() {316 TokenizerModel model = null;317 try {318 try (InputStream tokenizerModelDeAsIS = Thread.currentThread().getContextClassLoader().getResourceAsStream(DE_TOK_MODEL)) {319 model = new TokenizerModel(tokenizerModelDeAsIS);320 }321 } catch (IOException ex) {322 log.error("Failed to load tokenizer model", ex);323 }324 tokenizerModel = model;325 }326 327 317 public void initLanguageDetector() throws IOException { 328 318 List<LanguageProfile> languageProfiles = new LanguageProfileReader().readAll();
Note: See TracChangeset
for help on using the changeset viewer.