What does Three-Way Brand Collision Pre-Screening conclude, in numbers, about “Far in Spelling, Near in Sound: Edit Distance, Sound Skeletons and the Channels of Confusion”?

Answer: Look first at the top row, where the sound channel has a share of zero and every confusion comes from text. The visual ruler reaches an AUC of 0.906, plain letter edit distance 0.880, and sound code only 0.683. Now the bottom row, where every confusion comes from sound: the sound code rises to 0.893, letter distance falls to 0.789 and the visual ruler to 0.767. The lines cross in between. At a spoken share of 0.5, sound code stands at 0.789 against 0.825 for letters and 0.826 for the visual ruler, so the shape side still leads slightly; at a share of 0.8, sound code at 0.851 overtakes letter distance at 0.817.

Scope of the numbers: In an illustrative model, with the sound channel at eight tenths, the AUC of the sound code is 0.851 against 0.817 for letter edit distance. Parameters are illustrative; all calculations are generated by the book's programs; the book is general analysis, not individualised legal advice, and judgements of trademark similarity rest with official searches in each jurisdiction and professional agents.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.5, 0.683, 0.767, 0.789, 0.8, 0.817

pairs 2400(600 bases x 4 comparison names)
spokenconfletter soundexsoundvisualmax(s,v)
0.013170.8800.5970.6830.9060.709
0.213400.8490.6100.7120.8680.732
0.513680.8250.6540.7890.8260.791
0.814560.8170.6780.8510.8060.840
1.014510.7890.7170.8930.7670.867
Show the full program
# Chapter 1. p12: which distance predicts confusion depends on channel.
# Model: 600 random invented base names; each gets four comparison
# names: a respelling that keeps the sound (S), a look-alike letter
# swap that changes the sound (V), one random letter change (N) and
# an unrelated name (U). A confusion happens through a spoken channel
# with probability s, else a written one; logit P = -6 + 9 * sim,
# where sim is 1 - sound distance (spoken) or 1 - visual distance
# (written). Distances as in p11. AUC = Mann-Whitney probability with
# mid-ranks for ties. Channel model and constants are illustrative.
import math
import random
import re

SKEL = ((r"ch", "tsh"), (r"ph", "f"), (r"gh", "g"), (r"ck", "k"),
        (r"qu", "kw"),
        (r"q", "k"), (r"x", "ks"), (r"z", "s"), (r"y", "i"),
        (r"ee", "i"), (r"oo", "u"), (r"c(?=[ei])", "s"), (r"c", "k"))
VMULTI = (("rn", "m"), ("cl", "d"), ("vv", "w"))
VPAIRS = {frozenset(p) for p in ("il", "ij", "lt", "nh", "uv", "vy",
                                 "ce", "co", "oa", "bd", "pq", "ft")}
CODE = {c: d for d, g in (("1", "bfpv"), ("2", "cgjkqsxz"), ("3", "dt"),
                          ("4", "l"), ("5", "mn"), ("6", "r")) for c in g}
SOUND_OPS = ((r"f", "ph"), (r"k(?=[aou])", "c"), (r"s", "z"),
             (r"i", "y"), (r"([bdlmnprt])", r"\1\1"), (r"u", "oo"))
LOOK_OPS = (("n", "h"), ("h", "n"), ("c", "e"), ("e", "c"), ("a", "o"),
            ("o", "a"), ("l", "t"), ("t", "l"), ("b", "d"), ("d", "b"),
            ("m", "rn"), ("d", "cl"))


def lev(a, b, sub=None):
    prev = [float(j) for j in range(len(b) + 1)]
    for i, x in enumerate(a, 1):
        cur = [float(i)]
        for j, y in enumerate(b, 1):
            c = 0.0 if x == y else (sub(x, y) if sub else 1.0)
            cur.append(min(prev[j] + 1.0, cur[j - 1] + 1.0,
                           prev[j - 1] + c))
        prev = cur
    return prev[-1]


def skeleton(s):
    for pat, rep in SKEL:
        s = re.sub(pat, rep, s)
    if len(s) > 3 and s.endswith("e") and s[-2] not in "aeiou":
        s = s[:-1]
    return re.sub(r"(.)\1+", r"\1", s)


def vsub(x, y):
    return 0.3 if frozenset((x, y)) in VPAIRS else 1.0


def vskel(s):
    for pat, rep in VMULTI:
        s = s.replace(pat, rep)
    return s


def soundex(s):
    last, out = CODE.get(s[0], ""), []
    for c in s[1:]:
        d = CODE.get(c, "")
        if d and d != last:
            out.append(d)
        if c not in "hw":
            last = d
    return (s[0] + "".join(out) + "000")[:4]


def nd(a, b, sub=None):
    return lev(a, b, sub) / max(len(a), len(b), 1)


def make_name(rng):
    syl = [rng.choice("bdfgklmnprstvz") + rng.choice("aeiou")
           for _ in range(rng.choice((2, 3)))]
    return "".join(syl)


def apply_op(rng, name, ops, regex):
    order = list(ops)
    rng.shuffle(order)
    for pat, rep in order:
        hits = ([m.start() for m in re.finditer(pat, name)] if regex
                else [m.start() for m in re.finditer(re.escape(pat), name)])
        if hits:
            k = rng.choice(hits)
            if regex:
                return name[:k] + re.sub(pat, rep, name[k:], count=1)
            return name[:k] + rep + name[k + len(pat):]
    return name


def auc(pos, neg):
    allv = sorted([(v, 1) for v in pos] + [(v, 0) for v in neg])
    ranks, i = [], 0
    while i < len(allv):
        j = i
        while j < len(allv) and allv[j][0] == allv[i][0]:
            j += 1
        mid = (i + 1 + j) / 2.0
        ranks.extend(mid for k in range(i, j) if allv[k][1] == 1)
        i = j
    n1, n0 = len(pos), len(neg)
    return (math.fsum(ranks) - n1 * (n1 + 1) / 2.0) / (n1 * n0)


if __name__ == "__main__":
    rng = random.Random(20261113)
    rows = []
    for _ in range(600):
        a = make_name(rng)
        s1 = apply_op(rng, apply_op(rng, a, SOUND_OPS, True),
                      SOUND_OPS, True)
        v1 = apply_op(rng, a, LOOK_OPS, False)
        k = rng.randrange(len(a))
        n1 = a[:k] + rng.choice("abdeiklmnorstu") + a[k + 1:]
        for b in (s1, v1, n1, make_name(rng)):
            ka, kb = skeleton(a), skeleton(b)
            sp = 1.0 - nd(ka, kb)
            sv = 1.0 - nd(vskel(a), vskel(b), vsub)
            sl = 1.0 - nd(a, b)
            sx = 1.0 if soundex(a) == soundex(b) else 0.0
            rows.append((sl, sx, sp, sv, max(sp, sv)))
    print("pairs {}  (600 bases x 4 comparison names)".format(len(rows)))
    print("spoken  conf  letter soundex  sound  visual  max(s,v)")
    for share in (0.0, 0.2, 0.5, 0.8, 1.0):
        lab = []
        for sl, sx, sp, sv, mx in rows:
            sim = sp if rng.random() < share else sv
            p = 1.0 / (1.0 + math.exp(6.0 - 9.0 * sim))
            lab.append(rng.random() < p)
        cols = []
        for c in range(5):
            pos = [r[c] for r, y in zip(rows, lab) if y]
            neg = [r[c] for r, y in zip(rows, lab) if not y]
            cols.append(auc(pos, neg))
        print("{:5.1f} {:6d}  {:6.3f} {:7.3f} {:6.3f} {:7.3f} {:9.3f}"
              .format(share, lab.count(True), *cols))

Single source and citation

Fan, Y. (2026). Phonetic, Graphic and Semantic Distance between Trademarks: Pre-Screening Brand-Name Collisions from Fanqie Spellings to Sound Codes (Version 1.0.0), Chapter 1: Far in Spelling, Near in Sound: Edit Distance, Sound Skeletons and the Channels of Confusion. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-317 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026317,
  author    = {Fan, Yafu},
  title     = {Phonetic, Graphic and Semantic Distance between Trademarks: Pre-Screening Brand-Name Collisions from Fanqie Spellings to Sound Codes},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book