哪兩個字母不可能連在一起?

或者哪兩個連續字母出現的頻率最低。


寫了段 Mathematica 代碼

az = Range @@ ToCharacterCode["az"];
pairs = FromCharacterCode@Join[Permutations[az, {2}], Map[{#, #} , az]];
counts = Map[{Length@DictionaryLookup["*" ~~ # ~~ "*"], #} , pairs];
Map[#[[2]] , Select[counts, #[[1]] == 0 ]]

結果如下

{"bq", "bx", "cf", "cg", "cj", "cp", "cv", "cx", "dx", "fq", "fv",
"fx", "fz", "gv", "gx", "hj", "hx", "hz", "jb", "jc", "jd", "jf",
"jh", "jl", "jm", "jn", "jp", "jq", "jt", "jv", "jw", "jx", "jy",
"jz", "kx", "kz", "lx", "mg", "mx", "mz", "pq", "pv", "px", "qc",
"qd", "qe", "qf", "qg", "qh", "qj", "qk", "ql", "qm", "qn", "qo",
"qp", "qr", "qs", "qt", "qv", "qx", "qy", "qz", "sx", "tq", "tx",
"vb", "vc", "vf", "vj", "vk", "vm", "vp", "vq", "vw", "vx", "vz",
"wq", "wv", "wx", "xd", "xj", "xk", "yq", "zf", "zj", "zx", "qq"}

渣代碼,求優化


Method one:

Select[StringJoin /@ Permutations[CharacterRange["a", "z"], {2}],
And @@ Function[word, StringFreeQ[word, #]] /@ DictionaryLookup[] ]

Method two:

Select[StringJoin /@ Permutations[CharacterRange["a", "z"], {2}],
Length[DictionaryLookup[TemplateApply["*``*", #]]] == 0 ]

兩種結果都一樣

{bq,bx,cf,cg,cj,cp,cv,cx,dx,fq,fv,fx,fz,gv,gx,hj,hx,hz,jb,jc,jd,jf,jh,jl,jm,jn,jp,jq,jt,jv,jw,jx,jy,jz,kx,kz,lx,mg,mx,mz,pq,pv,px,qc,qd,qe,qf,qg,qh,qj,qk,ql,qm,qn,qo,qp,qr,qs,qt,qv,qx,qy,qz,sx,tq,tx,vb,vc,vf,vj,vk,vm,vp,vq,vw,vx,vz,wq,wv,wx,xd,xj,xk,yq,zf,zj,zx}

當然,我這裡是單詞中有哪兩個不同的字母不可能在一起,相樣的,如果要查哪兩個(包括相同)字母不可能在一起把Permutations改成Tuples即可,結果如下:

{bq,bx,cf,cg,cj,cp,cv,cx,dx,fq,fv,fx,fz,gv,gx,hj,hx,hz,jb,jc,jd,jf,jh,jl,jm,jn,jp,jq,jt,jv,jw,jx,jy,jz,kx,kz,lx,mg,mx,mz,pq,pv,px,qc,qd,qe,qf,qg,qh,qj,qk,ql,qm,qn,qo,qp,qq,qr,qs,qt,qv,qx,qy,qz,sx,tq,tx,vb,vc,vf,vj,vk,vm,vp,vq,vw,vx,vz,wq,wv,wx,xd,xj,xk,yq,zf,zj,zx}

發現其實就只多查到了qq,說明除了qq這一個組合外,任意兩個相同的字母組合都可以出現在單詞里。


不可能連在一起,不太可能,因為有縮寫,就算本來沒有我生造一個不就有了嗎


推薦閱讀:

Vim和Emacs哪個用戶數量更多?
你有哪些 Vim 綜合征?
Vimrc 能否將 capslock 綁定為 esc 鍵?
Vim 約等於記事本嗎?
如何評價Vim配置文件SpaceVim?

TAG:英語 | Vim | 字母頻率 |