@Override
  public void document(Document document) {
    Map<String, String> documentMap = new HashMap<String, String>();
    for (Field field : document.getFields()) {
      documentMap.put(field.getName(), field.getValue());
    }

    StrSubstitutor sub = new StrSubstitutor(documentMap);
    String value = sub.replace(output);

    document.addField(outputField, value);

    super.document(document);
  }
  @Override
  public void end() {

    List<String> dictionaryList = new ArrayList<String>(dictionary);
    Collections.sort(dictionaryList);

    for (String value : dictionaryList) {
      Document document = new Document();
      document.addField("noun", value);
      super.document(document);
    }

    super.end();
  }