knowledge: rename ExtractSignature.stop -> stop_table (his review)
The field's purpose was unclear from its name; stop_table says what it stops. Renamed across the signature, its desc/docstring, the caller (raw.stop_table), the wiki.py legacy note, and the test fakes.
This commit is contained in:
@@ -92,18 +92,18 @@ def test_process_page_fragments():
|
||||
wikitext=WIKITEXT_2TABLES)
|
||||
page.tables = parse_tables(WIKITEXT_2TABLES)
|
||||
|
||||
# scripted extractor: world-table parts -> stop=True; Italy table -> one Fact
|
||||
# scripted extractor: world-table parts -> stop_table=True; Italy table -> one Fact
|
||||
calls = []
|
||||
|
||||
class FakeOut:
|
||||
def __init__(self, facts, stop=False):
|
||||
def __init__(self, facts, stop_table=False):
|
||||
self.facts = facts
|
||||
self.stop = stop
|
||||
self.stop_table = stop_table
|
||||
|
||||
def fake_extract(question, heading, text, _calls=calls):
|
||||
_calls.append((question, heading, text))
|
||||
if "World rivers" in text:
|
||||
return FakeOut([], stop=True)
|
||||
return FakeOut([], stop_table=True)
|
||||
if "Rivers of Italy" in text:
|
||||
# quote = the full rendered row context (header + row), verbatim
|
||||
# from the fragment the extractor saw
|
||||
|
||||
Reference in New Issue
Block a user