Package com.stbasarab
Class Main
java.lang.Object
com.stbasarab.Main
The main class that handles the execution of the program.
It reads a text file, processes the text to find unique words in the first sentence,
and prints the result to the console.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WordFinds the first unique word in the first sentence of the given text.static voidThe entry point of the application.
-
Constructor Details
-
Main
public Main()
-
-
Method Details
-
main
The entry point of the application.- Parameters:
args- command-line arguments (not used)- Throws:
RuntimeException- if there is an error reading the file or finding the unique word
-
findUniqueWordInFirstSentence
Finds the first unique word in the first sentence of the given text.- Parameters:
text- the Text object containing the sentences- Returns:
- the first unique Word found in the first sentence
- Throws:
RuntimeException- if there are no sentences or if no unique word is found
-