// TODO: Do something intelligent.
public void initialize() {
    PayloadTrieBuilder<Item> itemsByNameBuilder = PayloadTrie.builder();
    itemsByNameBuilder
        .ignoreCase()
        .ignoreOverlaps();
    spammyItems = getSpammyItems();
    BufferedReader bufferedReader;
    try {
      bufferedReader = new BufferedReader(new FileReader(ITEM_FILE));
      String line = null;
      while ((line = bufferedReader.readLine()) != null) {
        String[] parts = line.split("\t");
        String name = parts[0];
        String url = parts[1];
        Item item = new Item(name, url);
        itemsByNameBuilder.addKeyword(normalize(name), item);
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      // TODO: Do something intelligent.
    } catch (IOException e) {
      e.printStackTrace();
      // TODO: Do something intelligent.
    }
    itemsByName = itemsByNameBuilder.build();
  }
} catch (FileNotFoundException e) {
e.printStackTrace();
// TODO: Do something intelligent.
} catch (IOException e) {
e.printStackTrace();
String line = null;
while ((line = bufferedReader.readLine()) != null) {
String[] parts = line.split("\t");
String name = parts[0];
String url = parts[1];
Item item = new Item(name, url);
itemsByNameBuilder.addKeyword(normalize(name), item);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
// TODO: Do something intelligent.
} catch (IOException e) {
e.printStackTrace();
// TODO: Do something intelligent.
}
itemsByName = itemsByNameBuilder.build();
}
public void initialize() {
PayloadTrieBuilder<Item> itemsByNameBuilder = PayloadTrie.builder();
itemsByNameBuilder
.ignoreCase()
.ignoreOverlaps();
spammyItems = getSpammyItems();
BufferedReader bufferedReader;
try {
bufferedReader = new BufferedReader(new FileReader(ITEM_FILE));
String line = null;
while ((line = bufferedReader.readLine()) != null) {
String[] parts = line.split("\t");
String name = parts[0];
String url = parts[1];
Item item = new Item(name, url);
itemsByNameBuilder.addKeyword(normalize(name), item);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
// TODO: Do something intelligent.
} catch (IOException e) {
e.printStackTrace();
// TODO: Do something intelligent.
}
itemsByName = itemsByNameBuilder.build();
}