# The same accent can rescue a match or count one prediction twice

Two files show a case called “case-é.” One file holds the reference answers, the other the predictions to be scored. The names look identical. Behind the final letter, though, one file stores a single character and the other stores an e followed by an accent.

We tried treating the two ways of writing the name as equivalent. In one of our invented deliveries, two answer rows could then claim the same prediction. In the other, the rule recovered a match that the exact spelling missed. Which result you want depends on whether those rows were meant to describe the same case.

A case ID connects one prediction to the right reference answer. Here the matching decision turns on a single letter at the end of the name.

## Two ways to write é

One program can write `case-é` with an é at the end. Another can write an e and then a separate combining acute accent mark. They look alike on screen but are different sequences of Unicode characters. An exact comparison keeps the spellings separate. Unicode Normalization Form C, or NFC, gives these two canonically equivalent spellings the same form for comparison. [Unicode normalization](https://www.unicode.org/reports/tr15/tr15-58.html)

## Look at how many rows lay claim to the accented name

In each of our two small sets of answer and prediction files the answer and prediction files both had a plain ID that appeared just once on each side. That match worked under either rule. The difference lay in the accented IDs.

In the first delivery the answer file had two rows: one for each spelling of the accented name, in addition to the plain ID. The prediction file had only one accented row. In the second delivery each file had just one accented row, and the file on each side used a different spelling.

A pair here is one answer row linked to one prediction row. In the first delivery, exact matching paired the accented prediction with just one answer row. Under NFC the two distinct answer IDs became one comparison key. Both rows could now claim that prediction. That gave two pairs for the accented prediction and one for the plain prediction, three matches from just two predictions.

In the second delivery, exact matching paired only the plain ID. NFC also paired the two accented names, bringing the count from one pair to two. The missing match was recovered, and each prediction was still used exactly once.

**Matches under exact text comparison and NFC**

| Accented IDs in the two files | Exact text match | Match after NFC |
| --- | --- | --- |
| Both accented spellings in the answer file, one in the predictions | 2 pairs, each prediction used once | 3 pairs, one prediction used twice |
| One spelling in each file, with different spellings | 1 pair, the accented match is missing | 2 pairs, each prediction used once |

We wrote the tables as Parquet files using PyArrow 26.0.1. We compared their rows in DuckDB 1.4.4 in two ways: applying NFC to the IDs during matching and using DuckDB’s built-in NFC comparison rule. They gave the same counts. Neither comparison altered the names stored in the files. [DuckDB text comparison rules](https://duckdb.org/docs/1.4/sql/expressions/collations)

## Which rule does your test require?

Write down which spellings are meant to identify the same case. If you use NFC and require one prediction per case, check uniqueness on both sides after applying NFC. Investigate a repeated ID to learn whether it stands for one case or two separate cases the rule would collapse. If the test calls for exact text, use the stored spellings. In either case keep the original IDs. Record unpaired rows and any prediction that more than one answer row claimed.

## Related research

- [When two missing case IDs counted as a match](https://sapien1.com/research/check-evaluation-case-ids)
- [The highlight found the right letter in the wrong place](https://sapien1.com/research/check-text-annotation-offsets)

[Files and record IDs](https://sapien1.com/research#files)
