Example #1
0
JNIEXPORT void JNICALL
Java_org_linkgrammar_LinkGrammar_setDictionariesPath(JNIEnv *env,
                                              jclass cls, jstring path)
{
	const char *nativePath = (*env)->GetStringUTFChars(env,path, 0);

	// Java passes null pointers as the string "null"
	if (nativePath && strcmp(nativePath, "null"))
	{
		dictionary_set_data_dir(nativePath);
	}
	(*env)->ReleaseStringUTFChars(env,path, nativePath);
}
Example #2
0
VALUE dictionary_path_set(const VALUE self, VALUE dict_path) {
	char *pathstr = StringValuePtr(dict_path);
	dictionary_set_data_dir(pathstr);
	return Qnil;
}