mirror of
https://github.com/bab2min/Kiwi.git
synced 2026-06-17 01:54:27 +00:00
Update KiwiJava binding to 0.21.0
This commit is contained in:
parent
00d7a2eeb5
commit
51dfac482e
5 changed files with 49 additions and 14 deletions
|
|
@ -95,6 +95,23 @@ namespace jni
|
|||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct ValueBuilder<kiwi::ModelType> : public ValueBuilder<uint32_t>
|
||||
{
|
||||
using CppType = kiwi::ModelType;
|
||||
using JniType = jint;
|
||||
|
||||
CppType fromJava(JNIEnv* env, JniType v)
|
||||
{
|
||||
return (CppType)v;
|
||||
}
|
||||
|
||||
JniType toJava(JNIEnv* env, CppType v)
|
||||
{
|
||||
return (JniType)v;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct ValueBuilder<kiwi::Match> : public ValueBuilder<uint32_t>
|
||||
{
|
||||
|
|
@ -564,7 +581,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
|
|||
.template method<&JTypoTransformer::scaleCost>("_scaleCost"),
|
||||
|
||||
jni::define<JKiwiBuilder>()
|
||||
.template ctor<std::string, size_t, kiwi::BuildOption, bool>()
|
||||
.template ctor<std::string, size_t, kiwi::BuildOption, kiwi::ModelType>()
|
||||
.template method<&JKiwiBuilder::addWord>("addWord")
|
||||
.template method<&JKiwiBuilder::addWord2>("addWord")
|
||||
.template method<&JKiwiBuilder::addPreAnalyzedWord>("addPreAnalyzedWord")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue