Analysis of text is a crucial aspect of many computing applications. The ability to single out words and phrases allows us to look for example: themes, sentiment and complexity of language. For example, many on-line games allow players to message each other during the game and twitter users send different messages. Analysis of these messages might reveal a lot about the writers and their experience of the application they are using. In this project the requirement was to create a application that looks at sentences of text store the words using appropriate data structures and carry out an analysis of the words entered.
On running the programme the user is presented with two options:
- Enter the text via the keyboard?
- Read in the text from a file?
If ‘Option 1’ is selected then the user will enter one or more sentences of text, one sentence at a time.
The program then reports back some basic analysis of this text:
For example:
- Number of sentences entered
- Number of vowels
- Number of consonants
- Number of upper case letters
- Number of lower case letters
- The frequency of individual letters
If ‘Option 2’ is selected then a file of pre-written text is opened, read and a similar analysis is carried out and displayed on the console. In addition a file of “long words” is created as part of the application and saved in the current directory i.e. any words longer than 7 characters. A pre-set example text file was provided.