• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python query.get_assertion_definitions函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中whoami.query.get_assertion_definitions函数的典型用法代码示例。如果您正苦于以下问题:Python get_assertion_definitions函数的具体用法?Python get_assertion_definitions怎么用?Python get_assertion_definitions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_assertion_definitions函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_adjective_definition

 def test_adjective_definition(self):
     # Artificial sentence
     sentence = u'The Great Pyramid of Giza is the oldest of the three pyramids in Gyza.'
     expected = [u'pyramid', u'oldest pyramid', 'gyza pyramid']
     actual, entry = get_assertion_definitions(sentence, get_rep=True)
     self.assertItemsEqual(expected, actual)
     self.assertTrue(u'[mod: oldest' in entry)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例2: test_proper_noun

 def test_proper_noun(self):
     # artificial sentence
     sentence = u'Lee is an American engineer, computer scientist and iOS and internet expert'
     expected = [u'internet expert', u'computer scientist', u'expert', u'american',
                 u'scientist', u'american engineer', u'engineer']  # filtered out 'iOS'
     actual = get_assertion_definitions(sentence)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例3: test_one_word_entity

 def test_one_word_entity(self):
     sentence = u'Alan Mathison Turing was a British pioneering computer scientist, mathematician, logician, cryptanalyst, philosopher, mathematical biologist, and marathon and ultra distance runner.'
     expected = [u'computer scientist', u'ultra runner', u'mathematician', u'distance runner',
                 u'mathematical biologist', u'philosopher', u'runner', u'logician', u'scientist',
                 u'british', u'british scientist', u'pioneering scientist', u'biologist']  # filtered out 'marathon'
     actual = get_assertion_definitions(sentence)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例4: test_compound_noun_whole

 def test_compound_noun_whole(self):
     # artificial sentence
     sentence = u'Lee is an American engineer, computer scientist and computer system and internet expert.'
     expected = [u'internet expert', u'computer scientist', u'expert', u'american', u'scientist',
                 u'american engineer', u'engineer']  # filtered out 'system' and 'computer system'
     actual = get_assertion_definitions(sentence)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例5: test_two_of

 def test_two_of(self):
     # Artificial sentence
     sentence = u'Ben and Jerry were two of the most successful ice cream makers in the world.'
     expected = [u'maker', u'cream maker', u'ice cream maker', u'successful maker', u'world maker']
     actual, entry = get_assertion_definitions(sentence, get_rep=True)
     self.assertItemsEqual(expected, actual)
     self.assertTrue(u'[nummod: two' in entry)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例6: test_plural_subject

 def test_plural_subject(self):
     sentence = u'Business method patents are a class of patents which disclose and claim new methods of doing business.'
     expected = [u'class', u'patent']
     actual, entry = get_assertion_definitions(sentence, subject=[u'Business method patent'], get_rep=True)
     self.assertItemsEqual(expected, actual)
     self.assertFalse(u'subject: subject_number' in entry)
     self.assertTrue(u'subject: Business method patents' in entry)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例7: test_cardinal

 def test_cardinal(self):
     sentence = u'Certis CISCO Security Private Limited, formerly CISCO Security Private Limited, is one of the five commercial Auxiliary Police forces authorized to provide armed security officers to government organizations as well as private companies or individuals in Singapore.'
     # Spacy awkwardly attaches [commercial] to [auxiliary police] rather
     # than to [force]
     expected = [u'commercial auxiliary police force', u'auxiliary police force', u'force', u'police force']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:7,代码来源:test_assertion_definitions.py


示例8: test_ordinals_word_number_date

 def test_ordinals_word_number_date(self):
     sentence = u'The 2001 French Open was the second Grand Slam event of 2001 and the 100th edition of the French Open.'
     expected = [u'event', u'grand slam event', u'2001 event', u'edition', u'french open edition']
     # TODO-someday: [2001] in the subject [The 2001 French Open] is
     # recognized as ROOT, so we need to help whoami by telling what the
     # subject is. Maybe try undoing this in future spacy versions.
     actual, entry = get_assertion_definitions(sentence, get_rep=True, subject=[u'The 2001 French Open'])
     self.assertItemsEqual(expected, actual)
     self.assertTrue(u'[mod: second' in entry)
     self.assertTrue(u'[mod: 100th' in entry)
开发者ID:infolab-csail,项目名称:whoami,代码行数:10,代码来源:test_assertion_definitions.py


示例9: test_phrasal_norp

 def test_phrasal_norp(self):
     sentence = u'Municipal Pérez Zeledón is a Costa Rican football team playing at the top level in the Primera Division.'
     expected = [u'costa rican team', u'team', u'football team']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例10: test_person_longer

 def test_person_longer(self):
     sentence = u'Richard Harry Chapura Jr. is a former American professional football player who was a defensive tackle in the National Football League and the World League of American Football.'
     expected = [u'player', u'football player', u'former player', u'professional player', 'american player', u'american']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例11: test_number_written

 def test_number_written(self):
     sentence = u'One is the smallest integer that is strictly positive.'
     expected = [u'integer', u'smallest integer']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例12: test_number

 def test_number(self):
     sentence = u'5 is a lovely number.'
     expected = [u'number', u'lovely number']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例13: test_year

 def test_year(self):
     sentence = u'1066 (MLXVI) was a common year starting on Sunday of the Julian calendar.'
     expected = [u'common year', 'year']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例14: test_prep_before_beverb

 def test_prep_before_beverb(self):
     sentence = u"Titanic Quarter in Belfast, Northern Ireland is a large-scale waterfront regeneration, comprising historic maritime landmarks, film studios, education facilities, apartments, a riverside entertainment district, and the world's largest Titanic-themed attraction centred on land in Belfast Harbour, known until 1995 as Queen's Island."
     expected = [u'waterfront regeneration', u'large-scale waterfront regeneration', u'belfast regeneration', u'regeneration']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例15: test_multiple_spaces

 def test_multiple_spaces(self):
     sentence = u'Wolfgang Amadeus Mozart, baptised as Johannes Chrysostomus Wolfgangus Theophilus Mozart, was a prolific and influential composer of the Classical era.'
     subject = [u'Wolfgang Amadeus Mozart  ', u'Johannes Chrysostomus Wolfgangus Theophilus Mozart']
     expected = [u'era composer', u'influential composer', u'prolific composer', u'composer', u'classical era composer']
     actual = get_assertion_definitions(sentence, subject)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例16: test_multiple_prepositions

 def test_multiple_prepositions(self):
     sentence = u"Toby Purcell or Tobias Purcell was an Irish soldier in the Williamite War in Ireland."
     expected = [u'irish soldier', u'soldier', u'irish', u'williamite war soldier', u'ireland williamite war soldier']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例17: test_species

 def test_species(self):
     sentence = u"Teladoma helianthi is a moth in the Cosmopterigidae family."
     expected = [u'moth', u'cosmopterigidae family moth', u'family moth']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例18: test_semicolon_separated_sentence

 def test_semicolon_separated_sentence(self):
     sentence = u'Slate Run is a tributary to the Scioto River; it flows through the Northwest corner of Upper Arlington, Ohio.'
     expected = [u'tributary']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例19: test_named_entity

 def test_named_entity(self):
     sentence = u'The Son of Odin is a fictional character.'
     expected = [u'fictional character', u'character']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py


示例20: test_complex_noun_phrases

 def test_complex_noun_phrases(self):
     sentence = u'Anna is a talented, smart student; avid, focused reader; and terrific listener.'
     expected = [u'talented student', u'smart student', u'terrific listener', u'focused reader', u'avid reader', u'listener', u'student', u'reader']
     actual = get_assertion_definitions(sentence, get_rep=False)
     self.assertItemsEqual(expected, actual)
开发者ID:infolab-csail,项目名称:whoami,代码行数:5,代码来源:test_assertion_definitions.py



注:本文中的whoami.query.get_assertion_definitions函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python whois.query函数代码示例发布时间:2022-05-26
下一篇:
Python whisper.validateArchiveList函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap