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();
  }
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();
     
    } catch (IOException e) {
      e.printStackTrace();
     
    }
    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(); } catch (ioexception e) { e.printstacktrace(); } itemsbyname = itemsbynamebuilder.build(); }