Java Reference
In-Depth Information
12
19
24
To display the actual sentences, we will use the following sequence. The whitespace in-
dexes are one off from the token:
int start = 0;
for(int boundary : sentenceBoundaries) {
while(start<=boundary) {
System.out.print(tokenList.get(start) +
whiteList.get(start+1));
start++;
}
System.out.println();
}
The following output is the result:
When determining the end of sentences we need to consider
several factors.
Sentences may end with exclamation marks!
Or possibly questions marks?
Unfortunately, it missed the last sentence. This is due to the last sentence ending in an el-
lipsis. If we add a period to the end of the sentence, we get the following output:
When determining the end of sentences we need to consider
several factors.
Sentences may end with exclamation marks!
Or possibly questions marks?
Within sentences we may find numbers like 3.14159,
abbreviations such as found in Mr. Smith, and possibly
ellipses either within a sentence …, or at the end of a
sentence….
Search WWH ::




Custom Search