Sfoglia il codice sorgente

Fix query counting.

tags/v0.2
Ben Kurtovic 10 anni fa
parent
commit
cc7ac52a05
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. +3
    -1
      earwigbot/wiki/copyvios/__init__.py

+ 3
- 1
earwigbot/wiki/copyvios/__init__.py Vedi File

@@ -286,18 +286,20 @@ class CopyvioMixIn(object):
workspace.enqueue(parser.get_links(), exclude)

chunks = parser.chunk(self._search_config["nltk_dir"], max_queries)
num_queries = 0
for chunk in chunks:
if workspace.best.confidence >= min_confidence:
break
log = u"[[{0}]] -> querying {1} for {2!r}"
self._logger.debug(log.format(self.title, searcher.name, chunk))
workspace.enqueue(searcher.search(chunk), exclude)
num_queries += 1
sleep(1)

workspace.wait()
result = CopyvioCheckResult(
workspace.best.confidence >= min_confidence,
workspace.best.confidence, workspace.best.url, len(chunks),
workspace.best.confidence, workspace.best.url, num_queries,
time() - start_time, article, workspace.best.chains)
self._logger.info(result.get_log_message(self.title))
return result


Caricamento…
Annulla
Salva