kuromoji icon indicating copy to clipboard operation
kuromoji copied to clipboard

Builder method to configure custom ResourceResolver

Open logogin opened this issue 7 years ago • 3 comments

This small change adds ability to set custom ResourceResolver via Builder. Custom resolver will allow loading dictionaries from locations other than Java classpath.

logogin avatar Dec 20 '17 10:12 logogin

Any chance to get this merged?

logogin avatar Jan 23 '18 17:01 logogin

Could you elaborate a bit on the use-case of when you'd load custom dictionaries from locations other than the Java classpath? Just trying to understand the underlying use-case. Thanks.

cmoen avatar Jan 30 '18 09:01 cmoen

Thanks for the response! The are couple of use-cases:

  1. You need to update/recompile dictionaries without code change. In this case dictionaries may be stored separately from the library.
  2. Dictionary/model files may have licence different from one used for the source code. There could be internal policies which may prohibit to deploy software with mixed or special types of licences.
  3. You have a special central model storage, i.e. S3 where all models maintained.

It is also, in general, a very trivial change which is backwards-compatible and does not affect library API. The ResourceResolver interface is already there, it is just hardcoded to resolve always from classpath.

logogin avatar Jan 31 '18 10:01 logogin