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/19 15:40:42 UTC
[GitHub] [lucene-solr] mocobeta commented on a change in pull request #722: LUCENE-8863: handle some edge cases in Kuromoji DictionaryBuilder, en…
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_r295366836
##########
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:
And just wondering, why do we need "file:" prefix? I feel like that loading the dictionary data from arbitrary location could be problematic... (Am I missed anything?)
----------------------------------------------------------------
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