Keyboard tests

used with Keyboard Layout Analyzer

31 December 2017

KLA provides three tests by default:

  1. Alice in Wonderland, chapter 1.
  2. List of the most common words in English
  3. The SAT words

There are some 'problems' with this corpus.

  1. The spelling is American ... so color instead of colour, and catalog instead of catalogue, etc.
  2. In Alice, the text uses single quotes for dialogue (American style), as opposed to British style double quotes.
  3. In Alice, there are many "unusual" contstructs, such as words in ALL CAPS, and an abnormal amount of exclamation marks, parentheses, and hyphens.
  4. The frequency of the letters in Alice is different to the general frequency in English.
  5. The Common Words are not balanced... eg "the" is very common, but it's only in the list once. So the list is an unnatural text to type.
  6. Similarly with SAT words, there are many relatively obscure words that you will not type in daily use, some of which I admit I have not seen before.
  7. The common and SAT words are all lowercase, with no punctuation.
  8. Alice is a particular style of writing and particular word selection.

For the purposes of evaluating the different layouts, we use the following tests. There are two categories, English Text, and Programming. The idea was to get a wide variety of writing styles, including both British and American spelling and punctuation.
Ideally we would want the letter frequency order to be something like this, where ⍽ is the "space" character.


English Texts

FileLetter frequency orderDiscussion
Alice in Wonderland, Chapter 1⍽etoahnisrlduwgf,cymbp'kvA.I!-T;R:DEWO?S(H)NLxqjCMVYFPUzGK\B"Z By Lewis Carroll, as per KLA.
Putin's speech⍽etaonisrhldcumfgpyw,bv.kIUNTxS'W-CAEqjRMOzHL"P1D2?Y97:FG3B54KJZ;6 Putin's speech to the U.N., 29 September 2015.
Classic collection⍽etaonhsirdlumwfycg,pb.vkI-"T'HAS;MWBxqj?DFC!OGENLPzY:_JRKU(])1[83QV*6457 The first 100 lines or so of chapter 1 of the following classics, lifted from Project Gutenberg:
  • The Picture of Dorian Gray, by Oscar Wilde
  • Dracula, by Bram Stoker
  • A Scandal in Bohemia, by Arthur Conan Doyle
  • The Adventures of Huckleberry Finn, by Mark Twain
  • The Jungle Book, by Rudyard Kipling
  • Metamorphosis, by Franz Kafka
  • Moby Dick, by Herman Melville
  • Peter Pan, by J.M. Barrie
  • Pride and Prejudice, by Jane Austen
  • Romeo and Juliet, by William Shakespeare
  • A Tale of Two Cities, by Charles Dickens
  • Tarzan of the Apes, by Edgar Rice Burroughs
  • The Brothers Karamazov, by Fyodor Dostoyevsky
  • The Wonderful Wizard of Oz, by L. Frank Baum
  • The Adventures of Tom Sawyer, by Mark Twain
  • Ulysses, by James Joyce
Jonathan Livingston Seagull⍽etaonhisrldugfwycm,.pbvk"'ITFJ!HSW-?ALCGBjYOExzqMN;DPR:KV371U9 By Richard Bach. Borrowed from the Russians. Link found via Google. Uses doublequotes for dialogue.
The Little Prince⍽etaonhisrldum.wycf"g/p,bIvkT-A?xB!WH:Y'OjqSF;NGMzEXLDCV21P3J)(9654U7RZ$K8 By Antoine de Saint-Exupery, saved as txt from here, top and bottom matter removed. Link found via Google. Also, the dialogue was set in italics, so Firefox saved all that like /"That is a hat."/, which will favour layouts with the / unshifted. Doublequotes for dialogue.
Animal Farm⍽etaonhisrdlwmufgcypb,.vkT"SA-BxIN'MFCqHWj!EJO?;PRLzD:Y)G(UV149QX356K72 By George Orwell, borrowed from the Australian Project Gutenberg site. Link found via Google. Top and bottom matter removed. Uses doublequotes for dialogue.
The Scroll marked II⍽eltioasnhrmwdyIcfuvp.gbk;,?AWFqMNHTzxj-YBCSL From The Greatest Salesman in the World, by Og Mandino, borrowed from the Internet Archive. Link found via Google. Has excessive whitespace which I should clean up, but didn't, to make the tests repeatable for you.
A Message to Garcia⍽etoanisrhldcuwmfyg,pbkv."-IG?WSC';H&ANTq:xMYRzPE9O!BKLDj1U8 By Elbert Hubbard.
The Magic Story⍽etaonihsrdlmuwfcy,pgbI.vk;T-"xqMSWPz:BH()FjA?Y'LN!GDOC16R4V2U Part 2 of The Magic Story, by Frederick van Rensselaer Dey.
The War Prayer⍽etoairhnsdlufpwgcmy,bv-.k;T!"GHWI'LxAO/FP?YBq:MSNz[]UEDj By Mark Twain.
As a Man Thinketh⍽etaosinhrlducfmgy,wpbv.kT;AH-_IE"xjNSOCzMLqDBF:RU'GYWPV()!K?J By Dr. James Allen.
Typing Champ 1⍽eitonsarhlcpud,wfmgbykxv."qFBKjI?TEPO(;) The first test from Sean Wrona's typing championship, found here.
Typing Champ 2⍽enaoitsrdlhpgmw,uy.fbk1"2vcIH4[]AT3L9E:7BN%&')-8F$?R!{}M^(O+DG/>XW#6qP=x@JC5<ZYUSVjKQ The second test from Sean Wrona's typing championship, found here. This contains awkward punctuation and is indeed designed to be difficult to type.
Tao te Ching / Daode Jing⍽etoinasrhldu.cgfywmpvbT,kIWA"HS-x'?GEBYMCjNL1:274O;P365FDqzK!UVR89/>#)(<Q By Lao Tzu, as translated by Charles Muller, here. Top and bottom matter (including contents) removed, and cleaned up a bit ... removed horizontal lines, Chinese text, some excess carriage returns. Converted typographical quotes to ANSI quotes (single and double).
Poems⍽etaohnsridluymwgf,cbvpIkAT'.!;?-W:SBHODECFjzxMJGLNRq"PYK A collection of famous poems, pasted into one file. Titles are
  • In Flanders Fields by John McCrae
  • If by Rudyard Kipling
  • Daffodils by William Wordsworth
  • Sonnet 18 by William Shakespeare
  • The Soldier by Rupert Brooke
  • The Tyger by William Blake
  • Jabberwocky by Lewis Carroll
  • How Do I Love Thee? by Elizabeth Barrett Browning
Contains some unusual words and phrase construction, and general structure is not like prose.
The Universal Declaration of Human Rights⍽etoniarshldcfumygpbv,.wAE)(12NkqjTS3UWxMDI-RH;4Lz76895COGFPBYV The Universal Declaration of Human Rights, frequently used for demonstrating new scripts and conlangs.
Quotes⍽etonairshld"u-cmy1gw.fpb9v()8k,I567'4TASW23CBGHMEFDLxPRzJNO;jKq?VYU:!Z+#/XQ Some quotes by famous people, from the collection copyrighted by Prof Dr. Gabriel Robins, here. Copied as text, top and bottom matter removed, text cleaned up a bit (fixed " etc.). Contains more parentheses, dashes, whitespace and capitals than normal prose.
The United States Declaration of Independence⍽etonasirhdlucfmpg,bwyv.Hjk:;xFWTqABCzGSDU-IPJ7NKE][416' By Thomas Jefferson et al.
The Magna Carta⍽eotarsnhildfucm,bwypgv.'k()IjW-ACTExN1HGS235Rq4OMLBD6PzFJ8K7:9;/&VU#Y* English version of the Latin original, as signed by King John, under duress, 15 June 1215.
Pangrams⍽eiaourtsnlydhczpgkxm.fwvbqjJ,QBWTFP'AMS-V!G?DLCH"KNIZ:RO;XE& You know that quick brown fox? Big fjords vex quick waltz nymph. A large collection of one-line pangrams.
Pangrams (paragraphs).⍽eaiotnrsuhldycpmgwf.bkvzxqj,JTWQBAPF-SIM'VHG!DL?CKZ"EN:O;R1XY&U Paragraph-length pangrams.
Song lyrics⍽eotanshirldymuwgcfI'bv,kpATW.BMSCjNFO"HYGDPL][?)(RJ:x-zVE!qU;K2134 Lyrics from some famous songs from the 60s and 70s, mostly. Found all over the Internet. Titles included are:
  • Slow Hand (Pointer Sisters)
  • Eternal Flame (Bangles)
  • The Sound of Silence (Simon & Garfunkel)
  • Yesterday (Beatles)
  • American Pie (Don McLean)
  • My Way (Frank Sinatra)
  • My Heart Will Go On (Celine Dion)
  • The Power of Love (Jennifer Rush)
  • Angel (Sarah McLachlan)
A Nice Cup of Tea⍽etoainsrhludyfwcgpbm,.kv-IT*S'qABN1x/z3F;4OEC()jG?95LJ:MPZ72VRHW6 Instructions on how to make a cup of tea, by George Orwell.
Aesop's Fables⍽etaohnisrdlufmwgcy,pb.vkT"AIxWHMFSLB:OCqD;'-PjG?J!NEzKYRV)(UQ21Z Clever stories from the original Doctor Dolittle.
The Republic⍽etaonshirdulymcwf,gpbv.Ikj?;TA-SYqCxBW':HPNOLMFUGE!RDVzQK"JX By Plato.
The Fable of the Keys⍽etaoirnshdlcmupfygw.vbk,-T*S1D'xI9CAN2E583Q/4ROW:BMH6YF7Lz)JPKq(UG"j?V&%;_[$]Z!X The somewhat-controversial article by S.J. Liebowitz and Stephen E. Margolis, about the QWERTY and Dvorak layouts.
200 words, sentenced⍽eothansriwlumd,yfbc.gvkpIMWTjOAHBSNDF'LCUYEJGPKVR My own concoction of the top 200 most common English words. In an attempt to overcome the issues raised above, I took the top 200 most common words, and multiplied them by 201 minus their rank. So the most common word is used 200 times, next most common 199, etc, down to the 200th word being used once. Then we shuffle them nicely. Then I added a comma 10% of the time, and a period 5% of the time, and paragraphs. The result is beautiful kinda-English like "More she since on, home back way time and own between those still any by me has first, are also for some great now good so, own, also two are they of, then time from at go between. Are that by or have." I did try with the top 500 words but the result was just too large for KLA to process quickly.


To get some typical programming tests, I've used the following. There are so many different languages, and no sane list of the most popular (I'm aware of the various lists floating around the net, most of which actually show which languages people need the most help with, rather than USE the most), so I have taken all or some of the solutions to various problems, from Rosettacode.

FileLetter frequency orderDiscussion
Towers of Hanoi, A — M⍽oetinr,sam>()-f<dvl1ph+"cguERPS.NOT;IM=A:kC][bD2wL{}'$%F#3VyHU4_xB/G&!zK\W@|*Y6X~5jq9J?`87Z^Q All the solutions in dozens of different programming languages, to the Towers of Hanoi problem, lifted from Languages from A — M.
Towers of Hanoi, N — Z⍽oeitnrsa,-mdfl()vcp"1h=ug;k:b~w$.T'/xMN}{SP>2#3<Iy[]@C*D4_AR\OB+E|H%FVL!j&6G5Wz9^UXK?q8Y7JZ All the solutions in dozens of different programming languages, to the Towers of Hanoi problem, lifted from Languages from N — Z
QuickSort A — M⍽terioasnl(),pud-cf=hm1:Rgv;.[]EyIASTkxqL2wbNO#<D+>3"{}/F'CP49*_M58j7|6BHU%!QXWGV$@zY&J?`~K\Z^ As above for the Quicksort algorithm. I had to delete some code because it used too many non-keyboard characters which broke Firefox's console logging (lines were too long).
QuickSort N — Z⍽ertiaosnl,)(=-cudhfpmv:g.;yk1x"RS[]bqIwANT@LMC2PO_$<3+>{}E54D*B8/6'U7j9VHFWQ|XKY&?GzJ#~\%!Z^ As above for the Quicksort algorithm. I had to delete some code because it used too many non-keyboard characters which broke Firefox's console logging (lines were too long).
Keyboard Layout Editor⍽etiasolr"dn-cp=<>*humgb/.vyf}{k'xw:)(S,;z21!CM|jKT$&W+EPD3?LOA596IR4NBG_H#][%F8YUJ7qXV\Z~^ By Ian Prest, as an example of a modern one-page web app.
Game of Life⍽eroitnalds()cu,g=;fhpmb1[.]wy}{x+v-:C$O/_j"I2<BGL'E#|TAP3R&SH>k*DF5M@^WXNz\K46?qJ!U8Z7~%VY9 By John Conway, as implemented in the following languages, lifted from's_Game_of_Life.
Ada, C, C++, C#, Common Lisp, D, Go, Haskell, Java, JavaScript, Lua, OCaml, Pascal, Perl, Python, R, Ruby, Tcl. Mmm, that's odd... no PHP?
Pangram Checker⍽teasrnio()lcmugh"p.df;=b'_}{,:vx/<kPyw&zTCSq2>$-IjLA|?W1][NZUO\H+VEFY6!G#JKX*QMDBR3`^ As implemented in the following languages, lifted from
C, C#, C++, Go, Java, JavaScript, PHP, Ruby, Rust
I basically wanted something in the well-used/vibey Curly Braces languages.
Luhn credit card number checker⍽etinrscaulod()1mp2-h=9.7g;"3f,4I8vN6O5TbS:}{+wL_*'/CER]<[D$k>y%AxPUBVGM@!Hj?#|WKYF As implemented in the following languages, lifted from
C, Java, Python, C++, C#, Ruby, Swift, R, Perl, Objective-C, Ada, COBOL, Fortran
This language selection is from the IEEE list of top corporate languages for 2016, (page since deleted from their site) plus three languages used in CorporateLand, and the Luhn test is something you might have to do in a corporate ....