You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I put a string from any korean language: "유니코드 국제 회"
crash is occurred because of "no feature in text", this library work normally with english string like "hello world", how can i fix this issue?
Call from c++ via jni:
jmethodID detectSingle = env->GetStaticMethodID(clazz, "detectSingle", "(Ljava/lang/String;)Ljava/lang/String;"); // find method
if (detectSingle == nullptr) {
cerr << "ERROR: method void runDetect() not found !" << endl;
}
else {
text = "유니코드 국제 회";
// Construct a String
jstring jstr = env->NewStringUTF(text.c_str());
// Call the method on the object
jobject result = env->CallStaticObjectMethod(clazz, detectSingle, jstr); // call method
// Get a C-style string
const char* str = env->GetStringUTFChars((jstring)result, NULL);
resultString = str;
}
To Java:
public static String detectSingle(String text) throws LangDetectException { // <=== We will call this
detector = DetectorFactory.create();
detector.append(text);
try {
//System.out.println("Java run result: "+detector.detect());
return detector.detect();
} catch (LangDetectException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
The text was updated successfully, but these errors were encountered:
mickeyzo12
changed the title
Library is crash because of "no feature in text"
Library is crashed because of "no feature in text"
Sep 5, 2021
I put a string from any korean language: "유니코드 국제 회"
crash is occurred because of "no feature in text", this library work normally with english string like "hello world", how can i fix this issue?
Call from c++ via jni:
To Java:
The text was updated successfully, but these errors were encountered: