Basic Examples (2)
Basic Examples
(2)
Generate a list of code words:
{{0},{1,0},{1,1,0},{1,1,1}}
———
Get code words from a Wikipedia article for letter frequency of the whole alphabet:
KeyTake[LetterCounts[WikipediaData["computer"]],Alphabet[]]
a3549,b606,c2066,d1537,e5445,f840,g913,h1634,i3213,j29,k218,l1909,m1666,n3112,o3458,p1299,q61,r3270,s2824,t3989,u1515,v431,w517,x91,y689,z40
{{1,1,1,1},{0,1,0,0,0,1},{0,0,0,1},{1,0,1,0,0},{0,1,1},{1,0,0,0,1,1},{1,1,0,1,1,1},{1,0,1,0,1},{1,0,1,1},{1,1,0,1,1,0,1,1,1,1,0},{1,1,0,1,1,0,1,0},{0,0,0,0},{1,1,0,1,0},{1,0,0,1},{1,1,1,0},{0,1,0,0,1},{1,1,0,1,1,0,1,1,1,0},{1,1,0,0},{0,1,0,1},{0,0,1},{1,0,0,0,0},{1,1,0,1,1,0,0},{0,1,0,0,0,0},{1,1,0,1,1,0,1,1,0},{1,0,0,0,1,0},{1,1,0,1,1,0,1,1,1,1,1}}
AssociationThread[Alphabet[]%]
a{1,1,1,1},b{0,1,0,0,0,1},c{0,0,0,1},d{1,0,1,0,0},e{0,1,1},f{1,0,0,0,1,1},g{1,1,0,1,1,1},h{1,0,1,0,1},i{1,0,1,1},j{1,1,0,1,1,0,1,1,1,1,0},k{1,1,0,1,1,0,1,0},l{0,0,0,0},m{1,1,0,1,0},n{1,0,0,1},o{1,1,1,0},p{0,1,0,0,1},q{1,1,0,1,1,0,1,1,1,0},r{1,1,0,0},s{0,1,0,1},t{0,0,1},u{1,0,0,0,0},v{1,1,0,1,1,0,0},w{0,1,0,0,0,0},x{1,1,0,1,1,0,1,1,0},y{1,0,0,0,1,0},z{1,1,0,1,1,0,1,1,1,1,1}