info.bliki.wiki.model.WikiModel.setUp()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中info.bliki.wiki.model.WikiModel.setUp()方法的一些代码示例,展示了WikiModel.setUp()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WikiModel.setUp()方法的具体详情如下:
包路径:info.bliki.wiki.model.WikiModel
类名称:WikiModel
方法名:setUp

WikiModel.setUp介绍

暂无

代码示例

代码示例来源:origin: edu.umd/cloud9

public String getDisplayContent() {
 wikiModel.setUp();
 String s = "<h1>" + getTitle() + "</h1>\n" + wikiModel.render(getWikiMarkup());
 wikiModel.tearDown();
 s = DOUBLE_CURLY.matcher(s).replaceAll(" ");
 return s;
}

代码示例来源:origin: edu.umd/cloud9

/**
 * Returns the contents of this page (title + text).
 */
public String getContent() {
 String s = getWikiMarkup();
 // Bliki doesn't seem to properly handle inter-language links, so remove manually.
 s = LANG_LINKS.matcher(s).replaceAll(" ");
 wikiModel.setUp();
 s = getTitle() + "\n" + wikiModel.render(textConverter, s);
 wikiModel.tearDown();
 // The way the some entities are encoded, we have to unescape twice.
 s = StringEscapeUtils.unescapeHtml(StringEscapeUtils.unescapeHtml(s));
 s = REF.matcher(s).replaceAll(" ");
 s = HTML_COMMENT.matcher(s).replaceAll(" ");
 // Sometimes, URL bumps up against comments e.g., <!-- http://foo.com/-->
 // Therefore, we want to remove the comment first; otherwise the URL pattern might eat up
 // the comment terminator.
 s = URL.matcher(s).replaceAll(" ");
 s = DOUBLE_CURLY.matcher(s).replaceAll(" ");
 s = HTML_TAG.matcher(s).replaceAll(" ");
 return s;
}

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
public void process(WikiArticle article, Siteinfo siteinfo) throws IOException {
  counter++;
  if (counter >= max_counter) {
    throw new IOException("\nLimit reached after " + max_counter + " entries.");
  }
  String htmlText = "";
  WikiModel wikiModel = new WikiModel("${image}", "${title}");
  try {
    wikiModel.setUp();
    htmlText = wikiModel.render(article.getText(), false);
    if (htmlText == null) {
      System.out.println("An IOException occured!");
    } else {
      System.out.println(htmlText);
    }
  } finally {
    wikiModel.tearDown();
  }
}

代码示例来源:origin: info.bliki.wiki/bliki-core

wikiModel.setUp();
String htmlStr = wikiModel.render(s, false);
System.out.print(htmlStr);

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
  public void actionPerformed(java.awt.event.ActionEvent event) {
    String strData = input.getText();
    WikiModel wikiModel = new WikiModel(new Configuration(), Locale.ENGLISH, "${image}", "${title}");
    wikiModel.setUp();
    try {
      String result = wikiModel.render(strData, false);
      output.setText(result);
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      wikiModel.tearDown();
    }
  }
}

代码示例来源:origin: yahoo/FEL

} else {
  WikiModel wikiModel = new WikiModel("image::", "external::");
  wikiModel.setUp();
  try {
    html = wikiModel.render(s.substring(textStart + 27, textEnd));

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
  public void actionPerformed(java.awt.event.ActionEvent event) {
    String strData = input.getText();
    WikiModel wikiModel = new WikiModel(new Configuration(), Locale.ENGLISH, "${image}", "${title}");
    wikiModel.setUp();
    try {
      String result = wikiModel.render(new PlainTextConverter(), strData, false);
      output.setText(result);
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      wikiModel.tearDown();
    }
  }
}

代码示例来源:origin: edu.illinois.cs.cogcomp/wikipediaAPI-multilingual

wikiModel.setUp();

代码示例来源:origin: edu.illinois.cs.cogcomp/wikipediaAPI

wikiModel.setUp();
final List<Href> links = new ArrayList<Href>();
LinkAnnotationConverter renderer = new LinkAnnotationConverter() {

相关文章