Package com.stbasarab.componets
Class Sentence
java.lang.Object
com.stbasarab.componets.Sentence
Represents a sentence composed of various elements, including words and punctuation marks.
This class provides methods to construct a sentence from a string and retrieve its elements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the elements of the sentence.
-
Constructor Details
-
Sentence
Constructs a Sentence object from a given string. The string is normalized by replacing multiple whitespace characters with a single space, and is then split into words and punctuation marks.- Parameters:
sentence- the string representation of the sentence
-
-
Method Details
-
getElements
Retrieves the elements of the sentence.- Returns:
- an array of SentenceElement objects that make up the sentence
-