JAPE中的空间代币概念 [英] Concept of Space Token in JAPE

查看:160
本文介绍了JAPE中的空间代币概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试一个JAPE代码段,并试图理解空间令牌的概念.

I am trying out a JAPE snippet and trying to understand the concept of Space Token.

Phase: Apple
Input:  Token SpaceToken Lookup 
Options: control = appelt

Rule: Country
(
    {Token.string == "President"}  
    {SpaceToken}
    {Lookup.majorType==location} 

):impPersons

此JAPE标注的是美国总统,印度总统,但不标注PresidentIndia或PresidentUSA.如果我在上面的代码中从Input和LHS中删除了Space Token,则此注释将保持不变. 那么,如果使用带空间令牌的令牌而不带空间令牌的令牌都标注相同的元素,则基本区别是什么?

This JAPE is annotating President USA, President India but not PresidentIndia or PresidentUSA. This annotation remains same if I remove Space Token from Input and LHS in the above code. Then if with Space Token without Space Token both annotate the same elements, what is the basic difference?

任何帮助将不胜感激.

推荐答案

如果在Input批注中添加SpaceToken,jape也会考虑这些,否则,jape将忽略它们.

If you add SpaceToken in the Input annotations, jape will consider those as well, if not, jape will ignore them.

例如:

Input: Token, SpaceToken
Rule : {Token}{Token}{Token}
Will not match: Barack Obama President

因为是jape文件,所以

Because for jape the document is

{Token-Barack} {SpaceToken} {Token-Obama} {SpaceToken} {Token-President}.

如果从输入中删除SpaceToken,则jape将仅对令牌起作用,因此文档将为:

If you remove the SpaceToken from the input, jape will only operate on tokens, so the document will be:

{Token-Barack} {Token-Obama} {Token-President}

通常,您添加许多注释,并且文档不是那么平坦",并且规则的LHS试图匹配文档图形的任何部分.

Usually you add many annotations and the document is not that "flat" and the LHS of the rule is trying to match any parts of the document graph.

这篇关于JAPE中的空间代币概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆