kuromoji
kuromoji copied to clipboard
Builder method to configure custom ResourceResolver
This small change adds ability to set custom ResourceResolver
via Builder
. Custom resolver will allow loading dictionaries from locations other than Java classpath.
Any chance to get this merged?
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.
Thanks for the response! The are couple of use-cases:
- You need to update/recompile dictionaries without code change. In this case dictionaries may be stored separately from the library.
- 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.
- 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.