My lexical analysis tool is under way! Since my last post it has gained a GUI, the algorithms for extracting the raw words from a document and finding their frequency have been improved (thanks to /r/javahelp and /r/codereview for some help on that!). It now also outputs it’s findings in descending frequency order.
To order the list I used Collections.sort(), a very useful method that worked perfectly for this. All I had to do was make the Word class implement Comparable and then create another class that implements Comparator and it was ready to go!
Again, you can view the code for this project here.
Two things I love; programming and linguistics. What’s better to do than combine them both into one engaging project? The aim of this project is to create a lexical analysis tool, that when passed text will present you with various statistics and visual representations of the language used.
So far the program reads from a text file and outputs a list of words used, along with the frequency of which they are used. It doesn’t yet output them in any specific order, just the order in which they appear for the first time and it does not yet have a GUI. The code for this project can be found here.
Next I plan on outputting them in frequency order, from highest to lowest and then building a GUI for it.