Commit eedb8b3
committed
Generic fallback: don't append a country to a street address that skipped the city
A schema.org PostalAddress that carries a streetAddress but leaves
addressLocality empty has a hole in its hierarchy, and the generic location
composer then jumped straight from the street to the country: "City Museum
Tel Aviv-Yafo, Bialik Street 27, Israel". That names no findable place — the
country adds nothing once you are at street level without a city — and it is
exactly what the dedicated source omits.
So append the country only when nothing finer already stands in for it: no
addressRegion (the existing rule), and either the address named its city or it
gave no street at all, leaving the country the most specific thing we have.
A complete street/city/country hierarchy (livenation.de's shape) and a bare
city/country address both keep the country, unchanged.
Generic: keys off the schema.org PostalAddress convention, not a host. The
city-skipping shape is what ASP.NET/SharePoint CMSes emit when the venue record
has no city field, so any such site benefits.
Lifts both visit.tel-aviv.gov.il fallback locations from a diff to an exact
match; no other corpus case changes and no field regresses.
Fallback-coverage: criticalFieldsPct 75.2->77.1, allFieldsPct 55.9->56.9
(location matches 22->24).
The #728 control-chars test asserted the same city-skipping page's composed
location; its expected value moves to the new composition. That assertion is a
proxy for "the tolerant parse succeeded" (a value assembled from separate
JSON-LD fields, so it cannot leak from the raw <script> text), and it stays an
exact multi-field equality assertion — just as strong.
Refs #366
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018975YrYb81uQmAvG315fTE1 parent 1f9860f commit eedb8b3
4 files changed
Lines changed: 67 additions & 14 deletions
File tree
- dev/requirements/extractor/fallback
- extension-test/event-extractors
- extension/event-extractors/helpers
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
143 | 185 | | |
144 | 186 | | |
145 | 187 | | |
| |||
183 | 225 | | |
184 | 226 | | |
185 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
186 | 233 | | |
187 | 234 | | |
188 | 235 | | |
| |||
200 | 247 | | |
201 | 248 | | |
202 | 249 | | |
203 | | - | |
| 250 | + | |
204 | 251 | | |
205 | 252 | | |
206 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
| |||
0 commit comments