kinow commented on a change in pull request #110: TEXT-156: Fix the
RegexTokenizer to use a static Pattern.
URL: https://github.com/apache/commons-text/pull/110#discussion_r263613213
##########
File path: src/main/java/org/apache/commons/text/similarity/RegexTokenizer.java
##########
@@ -26,12 +26,14 @@
/**
* A simple word tokenizer that utilizes regex to find words. It applies a
regex
- * {@code}(\w)+{@code} over the input text to extract words from a given
character
+ * {@code (\w)+} over the input text to extract words from a given character
* sequence.
*
* @since 1.0
*/
class RegexTokenizer implements Tokenizer<CharSequence> {
+ /** The whitespace pattern. */
+ private static final Pattern pattern = Pattern.compile("(\\w)+");
Review comment:
s/pattern/PATTERN to fix checkstyle?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services