Honestly, when you published this challenge 2-3 months ago I said 'omg, this is no for me, this is for CIA or so...' haha
I think I've found a really easy way to solve it. I didn't look at any solution, I promise. And it didn't take more than 8 hours for sure.
So, first at all, in any text any language most of the words are separated by spaces or by punctuation marks and spaces, but spaces are always there...so as "a" and "y" decoded characters were always followed by a 'ks' coded pair...I just suposed that 'ks' meant actually " ".
Second, I splitted text with that " " decoded character:
Third, once we have splitted the text, we have (more or less) words, so we can build them and...why don't we count and order them descending?
(picture shows the words decoded...at this point, imagine I haven't already decoded)
...and why not looking for some help? let's look for the most common words in English here:
https://en.wikipedia.org/wiki/Most_common_words_in_EnglishFourth, as we can identify most of the most common words, we can identify very fast 15-20 characters through those words (and, to, the, of, in, you, that....). Now, why don't we try to read the text?
Now is fun, because at the beginning of the text I recognised the words 'project gutemberg' and 'shakespeare' :).....and after that a text where I could read literally 'for the use of anyone anywhere at no cost'...so I googled 'project gutenberg shakespeare hamlet' (as the challenge is called Ham Hamlet):
...and voilá! I should have click 'Voy a tener suerte' (spanish version for I'm Feeling Lucky) haha. It results that if you click on 'read this book online: html' you can find a text which first paragraph is exactly the same text I red...so I've found a
HAM HAMLET ROSSETA STONE
http://www.gutenberg.org/files/1524/1524-h/1524-h.htm
After that, I just wrote some other letters in the table till I had 26 correct decodings 🙂