@@ -227,31 +227,32 @@ public static String locateOriginalText(String fullLicenseText, int startToken,
227227 /**
228228 * Check whether the given text contains only a single token
229229 * <p>
230- * A single token string is a string that contains zero or one
231- * non-whitspace token as identified by the
232- * {@link LicenseTextHelper#TOKEN_SPLIT_PATTERN}.
230+ * A single token string is a string that contains zero or one token,
231+ * as identified by the {@link LicenseTextHelper#TOKEN_SPLIT_PATTERN}.
232+ * Whitespace and punctuation such as dots, commas, question marks,
233+ * and quotation marks are ignored.
233234 * </p>
234235 *
235236 * @param text The text to test.
236- * @return {@code true} if the text contains zero one token,
237+ * @return {@code true} if the text contains zero or one token,
237238 * {@code false} otherwise.
238239 */
239240 public static boolean isSingleTokenString (@ Nullable String text ) {
240241 if (text == null || text .isEmpty ()) {
241- return true ; // zero tokens is considered a single token string
242+ return true ; // Zero tokens is considered a single token string
242243 }
243244 Matcher m = LicenseTextHelper .TOKEN_SPLIT_PATTERN .matcher (text );
244245 boolean found = false ;
245246 while (m .find ()) {
246247 if (!m .group (1 ).trim ().isEmpty ()) {
247248 if (found ) {
248- return false ; // more than one token found
249+ return false ; // More than one eligible token found
249250 } else {
250- found = true ; // first token found
251+ found = true ; // First eligible token found
251252 }
252253 }
253254 }
254- return true ; // either no tokens or only one token found
255+ return true ; // Zero or one eligible token found
255256 }
256257
257258 /**
0 commit comments