You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/03/07 23:44:02 UTC

[GitHub] [commons-text] aherbert commented on a change in pull request #110: TEXT-156: Fix the RegexTokenizer to use a static Pattern.

aherbert 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_r263617049
 
 

 ##########
 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:
   Sorry. Ran `mvn test` but not the 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:
users@infra.apache.org


With regards,
Apache Git Services