FACE => face FOOD => food 1DEA => idea 1CE => ice BEEF => beef
形容词
A11 => all 01D => old BAD => bad C001 => cool DEAD => dead
如果只看 wordfreq small list 里的,那更少,只有 160 个。我自己稍微组了一些词:
FEE1BAAD => feel bad 这个其实不太可行,因为我用的 BAAD,也可以考虑 FEE15BAD A10EFOOD => aloe food DEB81DEA => debate idea BADCAB1E => bad cable ADD1ABE1 => add label DEADF001 => dead fool 差一点变成了 deadpool 1EAFFA11 => leaf fall 让我想起了 e.e. cummings 的诗 l(a
如果我们不允许任何 alias,只用 A-F 来组词,也是能组出一些的:
DEADBEEF => dead beef 经典 FEEDBABE => feed babe 张嘴,啊~ FADEDDAD => faded dad 我去买个橘子?
我挑了一些词:
部分只包含 A-F 的词
BAD => bad FACE => face DEAD => dead ADDED => added ADD => add BED => bed DAD => dad FEED => feed DECADE => decade FED => fed FEE => fee FACED => faced BEEF => beef ACE => ace BABE => babe BEE => bee DEAF => deaf CAB => cab FADE => fade DEED => deed FADED => faded BEAD => bead FACADE => facade DAB => dab FAD => fad BEADED => beaded EBB => ebb
可以看到长度为 5 的词很少,所以 3+5 和 5+3 这种搭配不好组词,只能 4+4 的组。
代码不长我就直接放这里了:
代码
import wordfreq from pathlib import Path
deftransform(x): result = x.upper() for c in x: ifnot c.isalpha(): returnNone if"I"in result and"L"in result: returnNone
# if result.endswith("ATE"): # result = result[:-3] + "8" # result = result.replace("L", "1") # result = result.replace("O", "0") # result = result.replace("I", "1") # result = result.replace("S", "5")
for c in result: ifnot c.isdigit() and c > "F": returnNone
words = {} for w in wordfreq.iter_wordlist("en", wordlist="small"): if w notin dictionary: continue w2 = transform(w) if w2 and w2 notin words and3 <= len(w2) <= 8: words[w2] = w
for w2, w in words.items(): print(f"{w:12} => {w2:12}")