本文整理汇总了Python中database.DatabaseManager.update_submission_match方法的典型用法代码示例。如果您正苦于以下问题:Python DatabaseManager.update_submission_match方法的具体用法?Python DatabaseManager.update_submission_match怎么用?Python DatabaseManager.update_submission_match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database.DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager.update_submission_match方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from database import DatabaseManager [as 别名]
# 或者: from database.DatabaseManager import update_submission_match [as 别名]
# the submission of this file may match older submissions better than the currently
# stored matches. Let's check to see if that's true and update it if so
for other_submission_id2, signatures in signatures_by_document.iteritems():
num_signatures = len(signatures)
signature_match = database.fetch_submission_match(other_submission_id2)
if signature_match is None:
continue
# having more signatures than the stored one is a good indicator
if num_signatures > signature_match.number_signatures_matched:
other_submission = database.fetch_a_submission(other_submission_id2)
line_matches, num_matches = match([submissions[0], other_submission])
# yup, we're more confident
if num_matches > signature_match.confidence:
if line_matches[0]:
database.store_matches(submission_id, other_submission_id2, line_matches[0], line_matches[1])
database.update_submission_match(
submission_id,
signature_match,
match_submission_id=other_submission_id2,
confidence=num_matches,
number_signatures_matched=num_signatures)
print 'done'
print 'sleeeep'
sleep(1)