You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by GitBox <gi...@apache.org> on 2022/11/18 21:33:35 UTC

[GitHub] [opennlp] kinow commented on a diff in pull request #385: OPENNLP-1320: Makes lemmatize of MorfologikLemmatizer thread-safe

kinow commented on code in PR #385:
URL: https://github.com/apache/opennlp/pull/385#discussion_r1026909511


##########
opennlp-morfologik-addon/src/main/java/opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java:
##########
@@ -47,7 +47,7 @@ public MorfologikLemmatizer(Dictionary dictionary) throws IllegalArgumentExcepti
     dictLookup = new DictionaryLookup(dictionary);
   }
 
-  private List<String> lemmatize(String word, String postag) {
+  private synchronized List<String> lemmatize(String word, String postag) {

Review Comment:
   >That would avoid the synchronization cost. Wdyt?
   
   That sounds like a good option to me. Avoids the `synchronized`, shouldn't add too much overhead, and the lib developers suggest it too. +1, thanks @rzo1 !



-- 
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: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org