🌳📖💻#3:🌳 — Word Frequenctrees
$ 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:
Enter some text, look at a 🌳 , and get the word frequencies in the stemmartin-martin.github.io
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.
- Taking text input and keeping some formatting by transforming the newline characters into
- Creating and hiding DOM Elements
And here is some Inception for you: