*This application parses the .txt files in a given directory, counts the frequencies of n-grams within, and ouputs them to a text file in CSV format. *
To compile successfully, use javac ie/atu/sw/FileName.java
from the src folder
Executable .class files are saved in same location.
This class is the entry to the application (containing the main method) and should be run to start it.
- This class provides the UI to the console for the user to interact and select option as provided in the starter code.
s
- Scanner objectp
- Parser object for access to Parser.java functionality
start()
- initialises menu and deals with user inputs, called from Runner.javashowOptions()
- prints options to console
- This class contains the functionality of the application, it parses files, processes them, and outputs the results.
freqTable
- multi-dimensional object array which stores frequencies of nGramsnGramSize
- stores the size of nGrams to be processed, set by userinputDirPath
- stores the path to the directory for processign as set by useroutPutName
- stores the name of the outout file as set by user
For brevity, getter & setter methods are not listed below:
Parser()
- constructor method initialises the size of the freqTable arrayexecuteNGramBuilder()
- primary function to begin process, called from MenuprintTable()
- outputs results to fileaddNGram()
- Add n-gram to freqTableprocessFile()
- read files and process them to nGramsparseDirectory()
- parses each file a given directorymakeNGrams()
- makes n-grams and saves them