You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/06/20 00:49:05 UTC

[GitHub] [lucene-solr] mocobeta commented on a change in pull request #722: LUCENE-8863: enable loading external Kuromoji dictionary

mocobeta commented on a change in pull request #722: LUCENE-8863: enable loading external Kuromoji dictionary 
URL: https://github.com/apache/lucene-solr/pull/722#discussion_r295577419
 
 

 ##########
 File path: lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/BinaryDictionary.java
 ##########
 @@ -46,13 +50,31 @@
   public static final String POSDICT_HEADER = "kuromoji_dict_pos";
   public static final int VERSION = 1;
   
+  static final String CLASSPATH = "classpath:";
+  static final String FILE = "file:";
+
+  private final String resourcePrefix;
   private final ByteBuffer buffer;
   private final int[] targetMapOffsets, targetMap;
   private final String[] posDict;
   private final String[] inflTypeDict;
   private final String[] inflFormDict;
   
   protected BinaryDictionary() throws IOException {
+    this(CLASSPATH);
+  }
+
+  /**
+   * @param resourcePrefix - where to load resources (dictionaries) from. Either "file:", followed
+   * by a filesystem directory and optionally a filename-prefix, or "classpath:", followed by a
+   * classpath location prefix, or just plain "classpath:" to use this class's name as the prefix.
+   */
+  protected BinaryDictionary(String resourcePrefix) throws IOException {
 
 Review comment:
   I missed the tests. OK, thanks!

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org