本文整理匯總了Python中regparser.layer.key_terms.KeyTerms.keyterm_is_first方法的典型用法代碼示例。如果您正苦於以下問題:Python KeyTerms.keyterm_is_first方法的具體用法?Python KeyTerms.keyterm_is_first怎麽用?Python KeyTerms.keyterm_is_first使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類regparser.layer.key_terms.KeyTerms
的用法示例。
在下文中一共展示了KeyTerms.keyterm_is_first方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_keyterm_is_first_not_first
# 需要導入模塊: from regparser.layer.key_terms import KeyTerms [as 別名]
# 或者: from regparser.layer.key_terms.KeyTerms import keyterm_is_first [as 別名]
def test_keyterm_is_first_not_first(self):
node = Node('(a) This has a list: apples et seq.',
label=['101', '22', 'a'])
node.tagged_text = '(a) This has a list: apples <E T="03">et seq.</E>'
kt = KeyTerms(None)
self.assertFalse(kt.keyterm_is_first(node, 'et seq.'))
示例2: test_emphasis_close_to_front
# 需要導入模塊: from regparser.layer.key_terms import KeyTerms [as 別名]
# 或者: from regparser.layer.key_terms.KeyTerms import keyterm_is_first [as 別名]
def test_emphasis_close_to_front(self):
""" An emphasized word is close to the front, but is not a key term.
"""
node = Node('(a) T et seq. has a list: apples',
label=['101', '22', 'a'])
node.tagged_text = '(a) T <E T="03">et seq.</E> has a list: apples'
kt = KeyTerms(None)
self.assertFalse(kt.keyterm_is_first(node, 'et seq.'))