The Case-Sensitive Symbol: When Capital Letters Carry Chemistry
A chemical formula looks like a short string of letters, and that appearance is misleading. In a formula, case is part of the code itself. One capital...
A chemical formula looks like a short string of letters, and that appearance is misleading. In a formula, case is part of the code itself. One capital letter followed by a small letter can name one element, while the same two letters written in capitals can name a compound built from two different elements. This measurement puts that test in its sharpest form, using deliberate collisions where folding case does not merely tidy a string but changes what the string means.
What The Case-Sensitive Symbol means
The Case-Sensitive Symbol is a symbol in which the pattern of upper and lower case is itself information, so that two spellings differing only in case are not two versions of one thing but names for two different things. In this measurement the symbols are chemical element symbols built under a simple convention: an element symbol begins with a capital letter and may continue with a lower case letter. Cobalt is written Co, a single element. Carbon monoxide is written CO, carbon followed by oxygen, two elements in sequence. The letters are the same and the order is the same, yet the second letter's case decides whether the string describes one substance or another.
The neighbouring concept is The Case Fold, which treated letter case as noise to be folded away in names. For personal and company names that instinct is often helpful, because the same name can arrive capitalised in several harmless ways and folding brings those variants together. The precise difference is that here case is meaning, and folding is exactly what destroys the distinction between two different substances. A fold that is a safe normalisation in one column becomes a source of error in another, not because the operation changed, but because the role of case in the underlying code changed. Recognising a case-sensitive symbol means asking, before any normalisation, whether case separates distinct values in this field.
Two sources, four spellings
The measurement begins with 300 distinct chemical formula strings built from 12 case-sensitive element symbols. The set was constructed to include the deliberate pairs Co, cobalt, versus CO, carbon monoxide, and No, nobelium, versus NO, nitric oxide. Those pairs are the centre of the design, because they guarantee that any method which erases case will face strings that become identical only after the erasure.
Source A stores canonical case, the spelling that follows the element convention exactly. Source B spreads four spellings, with 75 rows in each: canonical, all-uppercase, all-lowercase, and alternating case. None of the four groups changes the letters or their order. Every difference is a difference of case alone, which isolates the question cleanly.
What exact matching and folding each produced
An exact join matched 118 of 300 rows. That total combines the 75 canonical rows, which match trivially because both sources agree letter for letter and case for case, plus 43 rows whose transformed spelling coincides with the canonical form, such as single-symbol or already-uppercase formulas. An exact join recovers some transformed rows by accident, where the transformation happens to produce the canonical spelling anyway, so reporting the total without that breakdown would flatter the method.
Case-folding matched every row, and on a coverage chart that looks like complete success. The cost appears when the matched rows are examined rather than counted. Folding merged 2 pairs of distinct compounds, CO with Co and NO with No, producing 2 false-merge extra rows in 2 collision groups. A false merge is worse than a miss, because a miss is visible as an unmatched row, while a false merge looks like success and quietly attaches the records of one substance to another.
What a case-sensitive parser recovered
A case-sensitive element parser took a different approach. It read each formula using the element convention, splitting where a capital letter begins a new symbol and treating a following lower case letter as part of that symbol, so spellings could be interpreted by structure rather than surface equality. The parser recovered 295 of 300 rows with 0 parse failures. No string defeated the parsing rules outright. Every input produced a reading, and almost every reading agreed with the intended formula.
The 5 misses are genuinely ambiguous strings, and naming them shows why they resist any purely mechanical fix. They are CO parsed as Co, and NO, NO2, NO3 and NoNO mis-split. In each case the rewritten spelling no longer carries enough information to decide between two legitimate readings. These are strings no parser can resolve without outside context. The remainder is not a parser defect but a genuine loss of information at the moment case was rewritten.
That distinction also shapes how a team should present results to anyone who will act on them. A single percentage invites a quick decision, and a quick decision here would favour the method that looks complete. Splitting the report into matched rows, coincidental matches, false merges, and ambiguous misses slows the decision down in a useful way. Each category points to a different remedy: preserve case where it matters, add a parser where structure can be read, and ask for context where the string itself has gone silent. Keeping those remedies separate prevents one blunt fix from being applied to problems that only look alike on a summary line.
How the measurement was assembled
This was a deterministic synthetic measurement, run with seed 42, so the same construction produces the same set of formulas and the same split of spellings on every run. The formulas and spelling groups were built to specification rather than sampled from a live inventory. The joining, folding, and parsing steps used self-written parsing rules in the standard library, applied identically to every row. No commercial product measurement is involved: this is not a commercial product measurement, and no vendor tool was benchmarked or represented by these results.
Questions, answered
Does case-folding ever make sense for chemical formulas? Folding makes sense only as a way to gather candidate matches for later checking, never as the final decision on its own. In this measurement folding matched every row but merged CO with Co and NO with No, so any pipeline that folds must add a second step that separates distinct compounds again before the joined records are trusted or used downstream.
Why did the exact join match more than the canonical group alone? Because some transformed spellings coincide with the canonical form. Alongside the 75 canonical rows, 43 rows matched whose rewritten spelling happened to equal the canonical spelling, such as single-symbol or already-uppercase formulas. The exact join gets credit for those rows without understanding them, which is why the breakdown matters more than the total.
What makes the remaining misses different from ordinary unmatched rows? The 5 misses are genuinely ambiguous strings whose stored spelling supports two legitimate readings. CO parsed as Co is the clearest case, and NO, NO2, NO3 and NoNO were mis-split for the same reason. Resolving them requires outside context about which substance was intended, not a better string rule, because the deciding information is no longer present in the string.
How can a parser have no failures yet still miss rows? A parse failure would mean the rules could not read a string at all, and that happened 0 times. A miss means the parser produced a reading that was not the intended one. Producing a confident but wrong reading on an ambiguous string is a different event from failing to read it, and keeping the two apart prevents a tidy failure count from hiding real mismatches.
What should a team check before folding case in any column? The team should check whether case separates distinct values in that column, using known collision pairs if the field has them. If two values become one after folding, folding is unsafe as a final step for that field. The check is cheap and should be recorded with the cleaning rules.
Summary
Exact matching was safe but incomplete, recovering 118 of 300 rows and part of that total only by coincidence. Case-folding was complete but unsafe, matching every row while merging 2 pairs of distinct compounds into 2 collision groups with 2 false-merge extra rows. A case-sensitive element parser recovered 295 of 300 with 0 parse failures, and its 5 misses are genuinely ambiguous strings that no parser can resolve without outside context. Before normalising any field, establish whether the feature being normalised away carries meaning there. When it does, preserve it and parse by structure.
Sources
- Batch 22 SD measurement results, group AM4, covering the 300 formula strings, the four spelling groups, and the exact, folded, and parsed join counts reported above. (Source: batch 22 SD measurement results, group AM4)