- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中de.tudarmstadt.ukp.wikipedia.api.exception.WikiApiException
类的一些代码示例,展示了WikiApiException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WikiApiException
类的具体详情如下:
包路径:de.tudarmstadt.ukp.wikipedia.api.exception.WikiApiException
类名称:WikiApiException
暂无
代码示例来源:origin: dkpro/dkpro-jwpl
/**
* Serializes the graph to the given destination.
* @param destination The destination to which should be saved.
* @throws WikiApiException Thrown if errors occurred.
*/
public void saveGraph(String destination) throws WikiApiException {
try {
GraphSerialization.saveGraph(graph, destination);
} catch (IOException e) {
throw new WikiApiException(e);
}
}
private void initializeCategoryGraph() throws LexicalSemanticResourceException {
try {
this.catGraph = CategoryGraphManager.getCategoryGraph(wiki);
} catch (WikiApiException e) {
e.printStackTrace();
throw new LexicalSemanticResourceException("Category graph could not be initialized.",e);
}
}
代码示例来源:origin: dkpro/dkpro-jwpl
result = statement.executeQuery(query);
} catch (WikiApiException wae) {
logger.error(wae.getLocalizedMessage(), wae);
代码示例来源:origin: dkpro/dkpro-jwpl
/**
* Get infos only for a subset of articles.
* @param pPages A set of pages. Only this subset of wiki pages is used in the info object.
*/
public WikipediaInfo(Iterable<Page> pPages) throws WikiApiException {
if (pPages == null) {
throw new WikiApiException("The page set has to be initialized.");
}
pages = pPages;
averageFanOut = -1.0; // lazy initialization => it is computed and stored when it is accessed
degreeDistribution = new HashMap<Integer,Integer>();
categorizedArticleSet = new HashSet<Integer>();
// get number of pages
numberOfPages = 0;
while (pages.iterator().hasNext()) {
numberOfPages++;
pages.iterator().next();
}
}
代码示例来源:origin: dkpro/dkpro-jwpl
e.printStackTrace();
代码示例来源:origin: dkpro/dkpro-jwpl
public int getTaxonomicallyBoundPathLengthInNodes(Category cat1, Category cat2) throws WikiApiException {
int retValue = getTaxonomicallyBoundPathLengthInEdges(cat1, cat2);
if (retValue == 0) {
return 0;
}
else if (retValue > 0) {
return (--retValue);
}
else if (retValue == -1) {
return -1;
}
else {
throw new WikiApiException("Unknown return value.");
}
}
代码示例来源:origin: dkpro/dkpro-jwpl
} catch (WikiApiException e) {
logger.error("Page with hibernateID " + id + " not found.");
e.printStackTrace();
代码示例来源:origin: dkpro/dkpro-jwpl
/**
* Creates an {@link CategoryGraph} using a serialized DirectedGraph object.
* @param pWiki A {@link Wikipedia} object.
* @param location The location of the serialized graph
* @throws WikiApiException Thrown if errors occurred.
*/
public CategoryGraph(Wikipedia pWiki, File location) throws WikiApiException{
try {
constructCategoryGraph(pWiki, GraphSerialization.loadGraph(location));
} catch (IOException e) {
throw new WikiApiException(e);
} catch (ClassNotFoundException e) {
throw new WikiApiException(e);
}
}
代码示例来源:origin: dkpro/dkpro-jwpl
} catch (WikiApiException e) {
System.out.println("Page " + title + " does not exist");
e.printStackTrace();
System.exit(1);
代码示例来源:origin: dkpro/dkpro-jwpl
/**
* Gets the path length between two category nodes - measured in "nodes".
* @param node1 The first node.
* @param node2 The second node.
* @return The number of nodes of the path between node1 and node2. 0, if the nodes are identical or neighbors. -1, if no path exists.
*/
public int getPathLengthInNodes(Category node1, Category node2) throws WikiApiException {
int retValue = getPathLengthInEdges(node1, node2);
if (retValue == 0) {
return 0;
}
else if (retValue > 0) {
return (--retValue);
}
else if (retValue == -1) {
return -1;
}
else {
throw new WikiApiException("Unknown return value.");
}
}
代码示例来源:origin: dkpro/dkpro-jwpl
private static CategoryGraph tryToLoadCategoryGraph(Wikipedia wiki, String wikiId, String size) throws WikiApiException {
String defaultSerializedGraphLocation = getCategoryGraphSerializationFileName(wikiId, size);
File defaulSerializedGraphFile = new File(defaultSerializedGraphLocation);
if (defaulSerializedGraphFile.exists()) {
try {
logger.info("Loading category graph from " + defaultSerializedGraphLocation);
return new CategoryGraph(wiki, GraphSerialization.loadGraph(defaultSerializedGraphLocation));
} catch (IOException e) {
throw new WikiApiException(e);
} catch (ClassNotFoundException e) {
throw new WikiApiException(e);
}
}
else {
return null;
}
}
代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine
private Connection getConnection(RevisionAPIConfiguration config)
throws WikiApiException
{
Connection c;
try {
String driverDB = "com.mysql.jdbc.Driver";
Class.forName(driverDB);
c = DriverManager.getConnection(
"jdbc:mysql://" + config.getHost() + "/" + config.getDatabase(),
config.getUser(), config.getPassword());
if (!c.isValid(5)) {
throw new WikiApiException("Connection could not be established.");
}
}
catch (SQLException e) {
throw new WikiApiException(e);
}
catch (ClassNotFoundException e) {
throw new WikiApiException(e);
}
return c;
}
代码示例来源:origin: dkpro/dkpro-jwpl
throw new WikiApiException(e);
代码示例来源:origin: dkpro/dkpro-jwpl
throw new WikiApiException("Page ID must be > 0");
throw new WikiApiException(e);
代码示例来源:origin: dkpro/dkpro-jwpl
throw new WikiApiException("Revision ID must be > 0");
throw new WikiApiException(e);
代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine
throw new WikiApiException("Article data is inconsistent");
throw new WikiApiException(e);
代码示例来源:origin: dkpro/dkpro-jwpl
private Connection getConnection(Wikipedia wiki)
throws WikiApiException
{
DatabaseConfiguration config = wiki.getDatabaseConfiguration();
Connection c;
try {
String driverDB = "com.mysql.jdbc.Driver";
Class.forName(driverDB);
c = DriverManager.getConnection("jdbc:mysql://" + config.getHost()
+ "/" + config.getDatabase()+"?autoReconnect=true", config.getUser(),
config.getPassword());
if (!c.isValid(5)) {
throw new WikiApiException(
"Connection could not be established.");
}
}
catch (SQLException e) {
throw new WikiApiException(e);
}
catch (ClassNotFoundException e) {
throw new WikiApiException(e);
}
return c;
}
代码示例来源:origin: dkpro/dkpro-jwpl
throw new WikiApiException("Article data is inconsistent");
throw new WikiApiException(e);
代码示例来源:origin: dkpro/dkpro-jwpl
/**
* Helper method to obtain a connection via the given {@link RevisionAPIConfiguration} parameter.
* @param config Must not be {@code null}.
* @return A valid {@link Connection} to the database endpoint.
* @throws WikiApiException Thrown if errors occurred while opening a connection.
*/
protected Connection getConnection(RevisionAPIConfiguration config) throws WikiApiException
{
Connection c;
try {
String driverDB = config.getDatabaseDriver();
Class.forName(driverDB);
c = DriverManager.getConnection(config.getJdbcURL(), config.getUser(), config.getPassword());
if (!c.isValid(5)) {
throw new WikiApiException("Connection could not be established.");
}
}
catch (SQLException | ClassNotFoundException e) {
throw new WikiApiException(e);
}
return c;
}
代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine
throw new WikiApiException(e);
本文整理了Java中de.tudarmstadt.ukp.wikipedia.api.exception.WikiApiException类的一些代码示例,展示了WikiApiException类的具
本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.support.ZipUtils类的一些代码示例,展示了ZipUtils类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中de.tudarmstadt.ukp.wikipedia.api.exception.WikiApiException.printStackTrace()方法的一些代码示例,展示了
本文整理了Java中de.tudarmstadt.ukp.wikipedia.api.exception.WikiApiException.()方法的一些代码示例,展示了WikiApiExceptio
本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.support.ZipUtils.zipFolder()方法的一些代码示例,展示了ZipUtils.zipFol
本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.support.ZipUtils.isZipStream()方法的一些代码示例,展示了ZipUtils.isZi
本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.support.ZipUtils.normalizeEntryName()方法的一些代码示例,展示了ZipUti
本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange类的一些代码示例,展示了
本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange.stringToInt
本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange.parseYearsR
本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange.extractFour
本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange.containsTwo
本文整理了Java中de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.multi.ru.quote.YearsRange.()方法的一些代码示例
我是一名优秀的程序员,十分优秀!