mawiesne commented on code in PR #543:
URL: https://github.com/apache/opennlp/pull/543#discussion_r1272235280
##########
opennlp-tools/src/main/java/opennlp/tools/util/StringUtil.java:
##########
@@ -79,6 +81,30 @@ public static String toLowerCase(CharSequence string) {
return new String(cp, 0, cp.length);
}
+ public static CharBuffer toLowerCaseCharBuffer(CharSequence sequence) {
+ CharBuffer result = CharBuffer.allocate(sequence.length());
+ for (int cp : sequence.codePoints().toArray()) {
+ for (char c : Character.toChars(Character.toLowerCase(cp))) {
+ result.append(c);
+ }
+ }
+ result.clear();
+ return result;
+ }
+
+ /*
+ public static CharBuffer toLowerCaseCharBuffer(CharSequence string) {
Review Comment:
Will do / beautify once PR passes thorough testing from the community or
build servers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]