标签: apache-stanbol

如何将Jsoup文档转换为W3C文档?

我通过解析内部HTML页面构建了一个Jsoup文档,

public Document newDocument(String path) throws IOException {

    Document doc = null;
    doc = Jsoup.connect(path).timeout(0).get();
            return new HtmlDocument<Document>(doc);
}
Run Code Online (Sandbox Code Playgroud)

我想将Jsoup文档转换为org.w3c.dom.Document 我使用的可用库DOMBuilder,但是在解析时我得到org.w3c.dom.Documentnull.我无法理解这个问题,尝试搜索但无法找到任何答案.

用于生成W3C DOM文档的代码:

Document jsoupDoc=factory.newDocument("http:localhost/testcases/test_2.html"));
org.w3c.dom.Document docu= DOMBuilder.jsoup2DOM(jsoupDoc);
Run Code Online (Sandbox Code Playgroud)

有人可以帮我这个吗?

html-parsing jsoup apache-stanbol

9
推荐指数
2
解决办法
7141
查看次数

无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

我正在尝试安装stanbol并收到以下错误

无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

附加错误日志

[信息]

[错误]无法在项目org.apache.stanbol.entityhub.ldpath上执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test(default-test):存在测试失败.[错误] [错误]请参阅/ home/stanbol-trunk/entityhub/ldpath/target/surefire-reports了解各个测试结果.

[错误] - > [帮助1] org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目组织上执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test(default-test) .apache.stanbol.entityhub.ldpath:有测试失败.

有关各个测试结果,请参阅/ home/stanbol-trunk/entityhub/ldpath/target/surefire-reports.org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)位于org.apache.maven.life循环的org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) .internal.MojoExecutor.execute(MojoExecutor.java:145)org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder) .java:80)org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) )org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)atg.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)atg.apache.maven.cli.MavenCli.execute(MavenCli. java:584)org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)at sun.reflect.Nat 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中的iveMethodAccessorImpl.invoke0(本地方法),位于java.lang.reflect.Method.invoke(方法. java:606)org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)at org.codehaus .plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)引起:org.apache.maven.plugin.MojoFailureException :有测试失败.

有关各个测试结果,请参阅/ home/stanbol-trunk/entityhub/ldpath/target/surefire-reports.在Org.apache.maven.maven.malu.上的org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:254) .surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:854)org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java) :132)在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)... 19更多

[错误]

[错误]

[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:[错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[错误]

[错误]纠正问题后,您可以使用该命令恢复构建

[错误] mvn -rf:org.apache.stanbol.entityhub.ldpath

java maven-3 maven apache-stanbol

9
推荐指数
1
解决办法
6万
查看次数

如何在 NLP 框架中执行段落边界检测?

我正在努力从出现在英文报纸上的各种广告中提取人名。

但是,我注意到在提取其中存在的名称之前,我需要确定广告的边界,因为我只需要提取第一个出现的名称。我从斯坦福 NLP 开始。我成功提取了名称。但我陷入了识别段落边界的困境。

有没有办法识别段落边界。?

text-processing nlp stanford-nlp opennlp apache-stanbol

5
推荐指数
1
解决办法
2706
查看次数