Commit f6137b5
Keep every substituent on a spiro side ring, and prime them all
`extract_spiro_side_prefixes` matched one leading locant group and
treated everything after it as a single substituent name, so only the
first side-ring prefix was primed. Worse, its stereo-descriptor strip
recognised R/S but not E/Z, so `(5E)-1-butyl-5-butylidene-1,3-diaza…`
matched nothing at all and the function returned no prefixes: an entire
butyl and butylidene disappeared from the name rather than merely losing
their primes.
Prime every top-level locant instead. Two things must not be primed.
Locants inside a nested substituent number that substituent's own
skeleton -- `(2,6-difluoro-3-methylphenyl)` -- so priming is tracked by
parenthesis depth. Digits within a name, as in `but-2-en-1-yl`, are
recognised by the fragment that follows them.
The side ring's stereo descriptor stays dropped. Re-emitting it inline
put it in the middle of the assembled name, which reads back as a
different molecule; that attempt broke 41 names and is reverted. It
belongs at the front of the whole name, which this string-level renderer
cannot reach, so a missing descriptor is preferred to a misplaced one --
the one molecule this leaves incomplete is now wrong only in its E/Z,
where before it was missing two whole substituents.
A stereo descriptor opening the right-hand side now takes a hyphen, so
`1-methyl(5'E)-…` no longer runs together.
58 corpus names fixed, 0 broken. pubchem mismatches 7 -> 5; zinc22
stays at 0. 1301 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 1cf8d42 commit f6137b5
3 files changed
Lines changed: 76 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
293 | 302 | | |
294 | | - | |
295 | | - | |
296 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
297 | 336 | | |
298 | 337 | | |
299 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1908 | 1908 | | |
1909 | 1909 | | |
1910 | 1910 | | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
1911 | 1936 | | |
1912 | 1937 | | |
1913 | 1938 | | |
| |||
0 commit comments