“ヤマダ電機” versus “ヤマダデンキ”: spelling variants and duplicates had three overlapping causes

日本語版

Development log of the Toreca Dash app / August 2026

In my app Toreca Dash, the same store’s name was written differently, such as “ヤマダ電機” and “ヤマダデンキ” (both Yamada Denki). Two reports came: “spellings vary” and “articles are duplicated for the same reason”. The instruction was: “make sure it does not happen for other stores either, thoroughly”.

This article records that three causes overlapped, and the process of fixing with a general rule instead of a synonym table.

Written from my work log of 25 August 2026.

Three causes overlapped

  1. Store names were compared only by “contains”. The two Yamada spellings contain neither one another, so they were different stores.
  2. Deadlines were compared to the millisecond. The same “until 26 Aug” was 23:59:00 from the aggregator and 23:59:59 from X, a 59-second difference that stopped them being seen as duplicates. Four real products were like this.
  3. The dedupe job was manual-only and had never run automatically. Even if I make it as a “one-off repair”, articles arrive daily, so duplicates are born daily.

The fix: no synonym table

I made a comparison key (storeNameComparisonKey). It drops corporate forms, symbols, spaces and full/half-width, turns katakana into hiragana, and unifies “電機 / 電器 / でんき”.

I do not make a table of store-name synonyms. It would recur whenever a new store appears. I made a general rule that unifies different writings that sound the same.

Two dangers found in testing

Both found by tests after the fix.

I checked 17 real patterns and found 0 mismatches.

Result

BeforeAfter
Store-name spelling variants20
Duplicates with same product, deadline and store7 groups0 groups

As a bonus, 23 store names with an advertising tail like “○○ @ staff wanted” were unified too. When there are duplicates, the one kept is the one with a price and a result-announcement date.

What I learned

Fix with a general rule, not a list; and run the fixing job automatically.

This is the English version of the original Japanese article.

More in English