mocobeta commented on a change in pull request #722: LUCENE-8863: handle some 
edge cases in Kuromoji DictionaryBuilder, en…
URL: https://github.com/apache/lucene-solr/pull/722#discussion_r295361715
 
 

 ##########
 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:
   If the resourcePrefix parameter takes only "classpath:" or "file:", would it 
be possible to use enum here instead of arbitrary String?.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to