找不到FirstToken用于某些引用(最后包含空格)。
脚本:
DECLARE FirstToken, LastToken;
BLOCK(InRef) Reference{}{
ANY{POSITION(Reference,1) -> MARK(FirstToken)};
Document{-> MARKLAST(LastToken)};
}
输入文件:
1. Ferreira, F.R., Prado, S.D., Carvalho, M.C, and Kraemer, F.B. (2015). Biopower and biopolitics in the field of food and nutrition. Revista de Nutrição, 28(1), 109-119. Available at http://dx.doi.org/10.1590/1415-52732015000100010.
2. Ali, S. (2007). Feminism and postcolonialism: Knowledge/politics. Ethnic and Racial Studies, 30(2), 191–212.
3. Forbes, D.A., King, K.M., Kushner, K.E., Letourneau, N.L., Myrick, A.F., and Profetto-McGrath, J. (1999). Warrantable evidence in nursing science. Journal of Advanced Nursing, 29(2), 373–379.
答案 0 :(得分:1)
以不可见的东西开头或结尾的注释也是不可见的。这个定义可能听起来不直观,但是顺序匹配也是必需的。
如果某些注释以带有空格的结尾开始,则最常发生这种情况。建议从注释中删除/修剪这些空格,例如:
RETAINTYPE(WS); // or RETAINTYPE(SPACE, BREAK,...);
Reference{-> TRIM(WS)};
RETAINTYPE;
如果您可以看到空格,您还可以处理以空格结尾的注释:
RETAINTYPE(SPACE);
除此之外,你还可以像MARKLAST一样使用MARKFIRST动作而不是POSITION条件,这非常慢。
免责声明:我是UIMA Ruta的开发者