예제 #1
0
  /**
   * Filters nonsense {{Information}} parameters and fills in missing default values.
   *
   * @param info The information template
   * @return A new Template with filtered keys and default values where applicable
   */
  private Template filterFillInfo(Template info) {
    Template t = new Template("Information");

    t.put("Description", info.has("Description") ? info.get("Description") : "");
    t.put("Date", info.has("Date") ? info.get("Date") : "");
    t.put(
        "Source",
        info.has("Source")
            ? info.get("Source")
            : String.format(
                "{{Transferred from|en.wikipedia|%s|%s}}", enwp.whoami(), Config.mtcComLink));
    t.put("Author", info.has("Author") ? info.get("Author") : "See below");
    t.put("Permission", info.has("Permission") ? info.get("Permission") : "");
    t.put("other versions", info.has("other versions") ? info.get("other versions") : "");

    return t;
  }