Skip to main content

Homoglyph confusion in the Discogs database (part 1)

A challenge in many data sets is how to properly deal with internationalization and characters. Discogs is no exception. In quite a few character sets there are characters that look exactly the same as characters in other character sets, but they aren't. Take for example the following two instances of a Rights Society name that I found in Discogs:
  1. BIEM
  2. ΒΙΕΜ
To the naked eye they might look the same (depending on the font the website is using), but they actually are not the same. The first one is all ASCII, but in the second one all the characters are from the Greek alphabet. From a data point of view these characters are very different! Characters that look a lot like other characters are called homoglyphs. I wrote about this before when looking at misspellings in Czechoslovak and Czech releases (which was essentially the same problem).

There are many examples of homoglyphs in the Discogs database and it can get confusing. For example, let's look at entries for a Greek rights society I found when researching errors in the Rights Society field, where we can find that three character sets are mixed:
  1. ΑΕΠΙ - all Greek
  2. AEΠΙ - first two characters ASCII, last two Greek
  3. AEΠI - all but the third character ASCII, third character Greek
  4. AEПI - all but the third character ASCII, third character Cyrillic
  5. AΕΠΙ - first character ASCII, rest Greek
  6. AΕΠI - first and last character ASCII, rest Greek
  7. АЕПI - last character ASCII, rest Cyrillic
  8. ΑΕΠΊ - all Greek
The last entry is interesting, as the last character is not a "capital iota" (as in the first entry of the list), but a "capital iota with tonos", which is a different character. In the Greek and Coptic Unicode block the former is U+0399, the latter is U+038A.

To make it even more interesting I also found 'ΑΕPI' in the data (first two characters Greek, last two ASCII) and 'AΕPI' (all but the second character Greek). For this particular rights society the correct way should either be all Greek, or all ASCII (depending on what is on the release). it should be possible to enforce this during data entry. I did not find entries where people had mixed Greek, Cyrillic and ASCII, or Greek and Cyrillic.

Discovering these errors is not easy to do using the Discogs search interface or by just going through release pages in Discogs. You actually can find the errors if you know the exact spelling mistakes that people have made. but by just browsing you would not spot them as they are not very common. The only way to discover this without spending endless amounts of time is automation.

Finding homoglyphs in the Discogs data

When looking at ASCII there are two character sets with which there will be the most confusion: Greek and Cyrillic, especially when using capitals. I tried to detect errors in several fields of the "Barcodes and Other Identifiers" section. A generic approach (seeing if people mixed ASCII and non-ASCII characters) turned out to be problematic with many false positives, as there were many different dots, spaces, slashes and pipes, from quite a few character sets, that obscured the real issue. I did find one instance of where a SPARS Code field had mixed Cyrillic and ASCII characters. As there are many instances where SPARS codes need to be fixed I am expecting that the real number will be a bit (but not much) higher.

For the rights societies I only tried to find the examples mentioned above, but I looked at not just the fields named Rights Society, but also the ones that should be. I found around 750 and they are distributed across the data as follows:

Rights Society with values containing characters from a wrong character set

The difficulty fixing these errors is that most people probably will not appreciate it (seeing it as a frivolous fix) or even understand what the problem is even about ("it looks the same"). My best guess for what a solution could be is to hardcode as many of these values as possible and provide them as a drop down box (possibly with a free text field for any markup differences or a description).

Other weird characters

There were a few other weird characters that I found just looking at the data. As already said there are many different dots, slashes, pipes and spaces but there are also a few very obscure characters like the "left-to-right mark". My guess is that this might have been entered by someone normally using "right-to-left". I have no idea how often this character actually is present in the data and I will leave that for another time.

My gut feeling tells me that I have barely begun to scratch the surface of this particular topic. I am already aware of some errors in the matrix/runout fields for old Soviet records, which I will look at in a future blogpost.

Comments

Popular posts from this blog

SID codes (part 1)

One thing that I only learned about after using Discogs is the so called Source Identification Code, or SID. These codes were introduced in 1994 to combat piracy and to find out on which machines a CD was made. It was introduced by Philips and adopted by IFPI, and specifications are publicly available which clearly describe the two available SID codes (mastering SID code and mould SID code). Since quite a few months Discogs has two fields available in the " Barcode and Other Identifiers " (BaOI) section: Mould SID code Mastering SID code A few questions immediately popped up in my mind: how many releases don't have a SID field defined when there should be (for example, the free text field indicates it is a SID field)? how many releases have a SID field with values that should not be in the SID field? how many release have a SID field, but a wrong year (as SID codes were only introduced in 1994) how many vinyl releases have a SID code defined (which is impossi...

SPARS codes (part 1)

Let's talk about SPARS codes used on CDs (or CD-like formats). You have most likely seen it used, but maybe don't know its name. The SPARS code is a three letter code indicating if recording, mixing and mastering were analogue or digital. For example they could look like the ones below. There is not a fixed format, so there are other variants as well. Personally I am not paying too much attention to these codes (I simply do not care), but in the classical music world if something was labeled as DDD (so everything digital) companies could ask premium prices. That makes it interesting information to mine and unlock, which is something that Discogs does not allow people to do when searching (yet!) even though it could be a helpful filter. I wanted to see if it can be used as an identifier to tell releases apart (are there similar releases where the only difference is the SPARS code?). SPARS code in Discogs Since a few months SPARS is a separate field in the Discogs ...

Using matrix numbers of CDs to verify release years (1)

One of the first steps when making CDs is to produce a "glass master". From that (using a few more steps) a "stamper" is created which is then used to press the actual CDs. When looking at a CD you can often see text in a ring in the middle of the CD. This is the so called matrix which comes from the glass master. Apart from the matrix other text (like the IFPI mastering SID code) could possibly also come from the glass master. A bit of background information can be found on page 7 of the IFPI SID code implementation guide although I would also highly recommend watching some of the clips about glass masters on YouTube, which are highly informative. One company making a lot of these glass masters is Cinram . For most of their glass masters they stored the production date in matrix. This is good news, because it means that it could possibly be used to verify releases and see if the declared year of the release is right: it could never have been released before...