- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
任何人都可以通过一些示例简要说明 Html 注释器、Html 转换器和 TEIViewWriter。我想在初始 View 中创建注释。
等待答案。
主要脚本:
PACKAGE uima.ruta.example;
SCRIPT uima.ruta.example.Html;
Document{-> EXEC(Html)};
WORDLIST JOURNALNAMELIST='JournalName.txt';
WORDLIST CITYPUBLIST='CITYPUB.txt';
DECLARE JOURNALNAME;
DECLARE CITYPUB;
Document{ -> MARKFAST(JOURNALNAME, JOURNALNAMELIST)};
Document{ -> MARKFAST(CITYPUB, CITYPUBLIST)};
DECLARE Reference;
"<a name=para(.+?)>(.+?)</a>"-> 2=Reference;
DECLARE FirstToken, LastToken;
BLOCK(InRef) Reference{}
{
ANY{POSITION(Reference,1) -> MARK(FirstToken)};
Document{-> MARKLAST(LastToken)};
}
DECLARE FIRSTWORD;
FirstToken PERIOD CW {->MARK(FIRSTWORD)};
HTML 脚本:
PACKAGE uima.ruta.example;
ENGINE utils.HtmlAnnotator;
ENGINE utils.HtmlConverter;
ENGINE utils.HtmlViewWriter;
TYPESYSTEM utils.HtmlTypeSystem;
TYPESYSTEM utils.SourceDocumentInformation;
Document{-> EXEC(HtmlAnnotator)};
Document { -> CONFIGURE(HtmlConverter, "inputView" = "_InitialView","outputView" = "plain"),
EXEC(HtmlConverter)};
Document{ -> CONFIGURE(HtmlViewWriter, "inputView" = "plain","outputView" = "_InitialView", "output" = "E:/ruta-2.4.0-source-release/ruta-2.4.0/example-projects/TextRulerExample/output"),
EXEC(HtmlViewWriter)};
示例 Html 输入文件:(通过更改扩展名手动转换为 html)
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 14 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.DAZZLEFN
{mso-style-name:DAZZLEFN;}
span.DAZZLELN
{mso-style-name:DAZZLELN;
color:#92D050;}
.MsoChpDefault
{font-family:"Calibri","sans-serif";}
.MsoPapDefault
{margin-bottom:10.0pt;
line-height:115%;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
-->
</style>
</head>
<body lang=EN-US>
<div class=WordSection1>
<p class=MsoNormal><a name=para0>REFERENCES</a></p>
<p class=MsoNormal><a name=para1>1.����������� Lawrence RA. A review of the
medical benefits and contraindications to breastfeeding in the United States
[Internet] . Arlington (VA): National Center for Education in Maternal and
Child Health; 1997 Oct [cited 2000 Apr 24]. p. 40. Available from:
www.ncemch.org/pubs/PDFs/Welcometojungle.pdf.</a></p>
<p class=MsoNormal><a name=para2>2.����������� Shishido A. Retraction notice:
Effect of platinum compounds on murine lymphocyte mitogenesis [Retraction of
Alsabti EA, Ghalib ON, Salem MH. In: Jpn J Med Biol 1979 Apr; 32(2):53-65]. Jpn
J Med Sci Biol 1980 Aug;33(4):235-237.</a></p>
<p class=MsoNormal><a name=para3>3.����������� Leist TP, Zinkernagel RM.
Effects of treatment with IL-2 receptor specific monoclonal antibody in mice
[letter] [Retraction of Leist TP, Kohler M, Eppler M, Zinkernagel RM. In: J
Immunol 1989 Jul 15; 143(2): 628-32]. J Immunol 1990 Apr 1;144(7):2847.</a> </p>
<p class=MsoNormal><a name=para4>4.����������� Alsabti EA, Ghalib ON, Salem MH.
Effect of platinum compounds on murine lymphocyte mitogenesis [Retracted by
Shishido A. In: Jpn J Med Sci Biol 1980 Aug; 33(4):235-7]. Jpn J Med Sci Biol
1979 Apr;32(2):53-65.</a></p>
<p class=MsoNormal><a name=para5>5.����������� Tidy JA, Parry GC, Ward P,
Coleman DV, Peto J, Malcolm AD, Farrell PJ. High rate of papillomavirus type 16
infection in cytologically normal cervices [letter] [Retracted by Tidy J,
Farrell PJ. In: Lancet 1989 Dec 23-30:2(8678-8679):1535]. Lancet 1989 Feb 25;1(8635):434.</a></p>
<p class=MsoNormal><a name=para6>6.����������� Magni F, Rossoni G, Berti F.
BN-52021 protects guinea-pig from heard anaphylaxis. Pharm Res Commun 1988
Dec;20 Suppl 5:75-78.</a></p>
<p class=MsoNormal><a name=para7>7.����������� Garvia EE, DeHaven ED. An
experimental analysis of response acquisition and elimination with positive
reinforcers. Behav Neuropsychiatry 1975 a April-1976 May;7(1-12):71-78.</a> </p>
<p class=MsoNormal><a name=para8>8.����������� Mueller FO, Schindler RD. Annual
survey of football injury research 1931-1985. [place unknown]: American
Football Coaches Assn; 1986. 24 p.</a></p>
<p class=MsoNormal><a name=para9>9.����������� Stern, Michael P. National
Institute of Arthritis, Diabetes, and Digestive and Kidney Diseases. Diabetes
in America: diabetes data compiled 1984.. [Bethesda (MD)]: The Institute; 1985
Aug. Diabetes in Hispanic Americans. Chapter 9. (NIH publication; no. 86- 1468).</a></p>
<p class=MsoNormal><a name=para10>10.��������� Vivian, Valerie L, editor. Child
abuse and neglect: a medical community response. 1st AMA National Conference on
Child Abuse and Neglect; 1984 March 30-June 31; Chicago. Chicago: American
Medical Association; 1985. 256 p.</a></p>
<p class=MsoNormal><a name=para11>11.��������� Popper, Hans, et al., editors.
Structural carbohydrates in the liver: proceedings of the 34th Falk Symposium;
1982 oct 12-19; Basil, Switzerland.Boston: MTB Press; 1983. 701 p.</a></p>
<p class=MsoNormal><a name=para12></a> </p>
</div>
</body>
</html>
最佳答案
请注意,您的示例脚本不包含提到的 TEIViewWriter。然而,问题是一样的。
不幸的是,示例脚本有一个错误:
线
Document{ -> CONFIGURE(ViewWriter, "inputView" = "plain",...
应该阅读
Document{ -> CONFIGURE(HtmlViewWriter, "inputView" = "plain",
...然后 NPE 就消失了。如果 HtmlParser 无法解析输入文本,则可能会出现另一个异常,从而导致 XMI 文件中缺少 Sofa。将文本包裹起来可能会有所帮助。
文件 HtmlConverter.ruta 和 TEIConverter.ruta here这些组件确实是很好的例子HtmlAnnotator 为 HTML 和 XML 标签/元素创建注释。 HtmlConverter 移除所有 HTML/XML 标签,将生成的文本存储在新 View 中并重新计算注释的偏移量。 TEIViewWriter 只是一个具有特定类型系统的 ViewWriter,它将特定 View 复制到新的 CAS 并存储它。这些组件一起能够将 TEI/Html/XML 文本转换为带有 xml 标记注释的纯文本。
documentation包含更多信息,例如,关于配置参数
免责声明:我是 UIMA Ruta 的开发者
关于uima - Uima Ruta 中的 Html Annotator,Html 转换器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37154527/
我在完成这个用于转换咖啡价格的 JavaScript 时遇到问题。我下载了一个调试器,它一直告诉我价格未定义,我不明白。这是脚本。 Coffee House
我有一个使用以下方法的 JSF 转换器: @Override public Object getAsObject(FacesContext context, UIComponent compo
我正在寻找类似paint.net 或Gimp 的东西,但对于音频文件,并在Windows 上运行。 最佳答案 Audacity太棒了 关于audio - 免费的声音编辑器/转换器?,我们在Stack
我目前正在使用以下代码来缩进 XML: transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputPr
我收到以下错误:Conversion Error setting value 'home' for 'null Converter'. Home是所显示内容的字符串表示形式。 对我来说,这没有意义。这
我的 UI 中有很多数字要处理。我希望它们中的一些没有小数位,一些是小数点后 2 位,而另一些是小数点后(3 位或 4 位小数)。 我有一个名为 DoubleToStringConverter 的转换
我正在制作一个货币转换器。转换器需要一个最小范围和最大范围,如果货币值高于或低于这些范围,转换器将要求您更改范围以能够转换货币。例如,如果用户将范围设置在 min-range 3 和 max-rang
我正在使用 Spring Shell 2 CLI,并尝试通过反射在运行时从定义的接口(interface)生成命令。 更新:接口(interface)的实现也是在运行时生成的。 我正在使用 Confi
我正在尝试编写一个通用的 Converter 以在我的代码中的多个类似情况下使用。我有一组子类,我只想使用一个 Converter 来处理,所以我想将一些东西(类类型/一些参数/等)传递给 Conve
我正在尝试读取一个在每个单元格中包含多个值的 csv 文件,并且我想将它们编码为单个 int 格式的字节以存储在 Pandas 单元格中,(例如 (1, 1) -> 771)。为此,我想使用 read
我正在 VC2013 中开发一个 c# Windows Phone 8.1 应用程序,并偶然发现了一个奇怪的问题。 为了使我的代码更“干净”,我决定将应用程序的不同部分放入不同的文件夹中。在 c# 代
是否有将 Puppet 脚本转换为 Chef 的转换器? 我找到了将 Chef 脚本转换为 Puppet 的 ruby 脚本 https://github.com/relistan/chef2pu
我已经开始寻找很好的解决方案,如何使用 Spring CassandraOperations 很好地持久化实体。问题开始是因为我的实体中的某些字段不受 cassandra 支持,例如乔达日期时间。 解
我知道如何实现单链表 monad 转换器,但无法运行其对应的数组。问题是存在分组效应,这使得转换器仅对可交换基 monad 有效。这是一个示例,为了简单起见,转换器和基础 monad 都是数组,并且没
当我尝试将值转换器从定义的枚举状态绑定(bind)到刷子时,我的 XAML 设计器中出现错误: 未找到“OKStatus”资源。 该应用程序在运行时运行良好,但我无法在设计器中看到我的 GUI。 我的
我需要使用列表单子(monad)变压器。我读到 ListT IO 存在潜在问题来自 Control.Monad.List , 自 IO不是可交换的,所以我在看 ListT done right .但我
不用多想,在我看来,一大组 Prolog 的功能可以实现为关系演算(a.k.a. SQL)。 有没有人听说过任何工具可以自动将 Prolog 转换为 SQL? 最佳答案 推荐: https://www
假设我在十六进制值(包括 alpha)中有这种颜色: x [1] "255 36 0" 但是,查看您请求的结果,您似乎在 x 中将 alpha 值作为第一个十六进制数。 - 所以你需要创建一个子字符
我正在寻找可用于跟踪程序进度的 monad 转换器。要解释如何使用它,请考虑以下代码: procedure :: ProgressT IO () procedure = task "Print som
我有一个非常基本的需求,即从数据库中获取一些数据并返回一个 DTO。我发现使用 nHibernate 连接多个表和“投影”可以说,到 DTO 是相当多的代码。在查看了几个示例后,大多数示例都不起作用,
我是一名优秀的程序员,十分优秀!