π³ππ»#3:π³ β Word Frequenctrees
Get yourself some literature and watch this great introduction, because inspired by the following beautiful bash line:
$ tr -s βA-Zβ βa-zβ < shakes.txt | tr -sc βa-zβ β\nβ | sort | uniq -c | sort -n -r | less
I spent most of my day building a mini-website:
It was also a practice in JavaScript, and an approach to make RegEx do small tasks for me. The site is another one-day-hack.
I wrote all of the functions myself β except for the final `sortWords()`. It was once again interesting to see how using code I didnβt fully understand broke my flow and had me backtrack a few times until figuring my way around. I doubt that using something has even half as much learning effect as making something.
While taking a break, I also realized that I will now probably suspend creating small webapps and instead focus on learning to use pythonβs NLTK.
I might have already watched enough basic NLP concepts in the beginning videos of my courses, so that it starts to make sense to learn to use a powerful toolset, such as NLTK.
Useful Bits
- Taking text input and keeping some formatting by transforming the newline characters into
<p>
- Creating and hiding DOM Elements
- Using JavaScript for simple text processing
And here is some Inception for you:
; )