let building words pass only on single-structure results

A building word ending the ask ('… Chapel', '… Library', '… Hall') now
passes the last-word rule only when the result is one a building ask
would accept, so a campus, zoo or district whose name merely starts the
ask (Duke University, Old Town) no longer answers it.
This commit is contained in:
Sameh Khamis committed 2026-11-02 09:07:31 -08:00
1 parent c059e12a11
commit 64c9f4cfa5
3 files changed
+18 -10

No files matched your search

@@ -1370,6 +1370,19 @@ test('a landmark ask is not answered by the place around it', () => {
.outline,
null,
);
// Nor on a campus or district whose name merely starts the ask.
for (const [query, name, category, type] of [
['Duke University Chapel', 'Duke University', 'amenity', 'university'],
['Old Town Hall', 'Old Town', 'historic', 'district'],
])
assert.equal(
selectOutlineResult(
[at(name, `${name}, Somewhere`, { category, type })],
landmark(query),
).outline,
null,
query,
);
});
test('a worse name never wins the anchor by containment alone', () => {