Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Feb 23, 2014
1 parent c1aafdf commit 9646f9b
Show file tree
Hide file tree
Showing 24 changed files with 1,622 additions and 1,153,630 deletions.
504 changes: 504 additions & 0 deletions LGPL

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ AUTOMAKE_OPTIONS = 1.4 no-dependencies dist-bzip2 no-dist-gzip
SUBDIRS = src model man
confdir = $(sysconfdir)
conf_DATA = cabocharc
EXTRA_DIST = LGPL BSD
EXTRA_DIR = perl ruby python java swig tools example doc
bin_SCRIPTS = cabocha-config

Expand All @@ -30,6 +31,7 @@ win-dist:
rm -fr @PACKAGE@-@[email protected] wintmp
mkdir wintmp
cp -f example/*.c example/*.cpp src/cabocha.h wintmp
cp -f BSD LGPL COPYING wintmp
mkdir wintmp/model
for txt in model/dep.ipa.txt model/chunk.ipa.txt model/ne.ipa.txt; do \
nkf -s $$txt > wintmp/$$txt; \
Expand Down
2 changes: 2 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ AUTOMAKE_OPTIONS = 1.4 no-dependencies dist-bzip2 no-dist-gzip
SUBDIRS = src model man
confdir = $(sysconfdir)
conf_DATA = cabocharc
EXTRA_DIST = LGPL BSD
EXTRA_DIR = perl ruby python java swig tools example doc
bin_SCRIPTS = cabocha-config
all: config.h
Expand Down Expand Up @@ -887,6 +888,7 @@ win-dist:
rm -fr @PACKAGE@-@[email protected] wintmp
mkdir wintmp
cp -f example/*.c example/*.cpp src/cabocha.h wintmp
cp -f BSD LGPL COPYING wintmp
mkdir wintmp/model
for txt in model/dep.ipa.txt model/chunk.ipa.txt model/ne.ipa.txt; do \
nkf -s $$txt > wintmp/$$txt; \
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,7 @@ fi

# Define the identity of the package.
PACKAGE=cabocha
VERSION=0.67
VERSION=0.68


cat >>confdefs.h <<_ACEOF
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_INIT(src/cabocha.cpp)
AH_TEMPLATE([HAVE_TLS_KEYWORD], [])
AM_INIT_AUTOMAKE(cabocha, 0.67)
AM_INIT_AUTOMAKE(cabocha, 0.68)
AM_MAINTAINER_MODE

# MODEL_VERSION XXYY
Expand Down
271 changes: 166 additions & 105 deletions java/CaboCha_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -977,58 +977,6 @@ SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_CABOCHA_1TRAIN_1DEP_1
}


SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_CABOCHA_1SHIFT_1REDUCE_1get(JNIEnv *jenv, jclass jcls) {
jint jresult = 0 ;
int result;

(void)jenv;
(void)jcls;
{
try {
result = (int)CABOCHA_SHIFT_REDUCE;
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jint)result;
return jresult;
}


SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_CABOCHA_1TOURNAMENT_1get(JNIEnv *jenv, jclass jcls) {
jint jresult = 0 ;
int result;

(void)jenv;
(void)jcls;
{
try {
result = (int)CABOCHA_TOURNAMENT;
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jint)result;
return jresult;
}


SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_Chunk_1link_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
Expand Down Expand Up @@ -1992,58 +1940,6 @@ SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_TRAIN_1DEP_1get(JNIEn
}


SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_SHIFT_1REDUCE_1get(JNIEnv *jenv, jclass jcls) {
jint jresult = 0 ;
CaboCha::ParsingAlgorithm result;

(void)jenv;
(void)jcls;
{
try {
result = (CaboCha::ParsingAlgorithm)CaboCha::SHIFT_REDUCE;
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jint)result;
return jresult;
}


SWIGEXPORT jint JNICALL Java_org_chasen_cabocha_CaboChaJNI_TOURNAMENT_1get(JNIEnv *jenv, jclass jcls) {
jint jresult = 0 ;
CaboCha::ParsingAlgorithm result;

(void)jenv;
(void)jcls;
{
try {
result = (CaboCha::ParsingAlgorithm)CaboCha::TOURNAMENT;
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jint)result;
return jresult;
}


SWIGEXPORT void JNICALL Java_org_chasen_cabocha_CaboChaJNI_Tree_1set_1sentence(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
char *arg2 = (char *) 0 ;
Expand Down Expand Up @@ -2946,13 +2842,178 @@ SWIGEXPORT jstring JNICALL Java_org_chasen_cabocha_CaboChaJNI_getLastError(JNIEn
}


SWIGEXPORT jboolean JNICALL Java_org_chasen_cabocha_CaboChaJNI_runDependencyTraining(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jint jarg4, jint jarg5, jdouble jarg6, jint jarg7) {
jboolean jresult = 0 ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
CaboCha::CharsetType arg4 ;
CaboCha::PossetType arg5 ;
double arg6 ;
int arg7 ;
bool result;

(void)jenv;
(void)jcls;
arg1 = 0;
if (jarg1) {
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
if (!arg1) return 0;
}
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
arg3 = 0;
if (jarg3) {
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return 0;
}
arg4 = (CaboCha::CharsetType)jarg4;
arg5 = (CaboCha::PossetType)jarg5;
arg6 = (double)jarg6;
arg7 = (int)jarg7;
{
try {
result = (bool)CaboCha::runDependencyTraining((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jboolean)result;
if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
return jresult;
}


SWIGEXPORT jboolean JNICALL Java_org_chasen_cabocha_CaboChaJNI_runChunkingTraining(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jint jarg4, jint jarg5, jdouble jarg6, jint jarg7) {
jboolean jresult = 0 ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
CaboCha::CharsetType arg4 ;
CaboCha::PossetType arg5 ;
double arg6 ;
int arg7 ;
bool result;

(void)jenv;
(void)jcls;
arg1 = 0;
if (jarg1) {
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
if (!arg1) return 0;
}
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
arg3 = 0;
if (jarg3) {
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return 0;
}
arg4 = (CaboCha::CharsetType)jarg4;
arg5 = (CaboCha::PossetType)jarg5;
arg6 = (double)jarg6;
arg7 = (int)jarg7;
{
try {
result = (bool)CaboCha::runChunkingTraining((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jboolean)result;
if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
return jresult;
}


SWIGEXPORT jboolean JNICALL Java_org_chasen_cabocha_CaboChaJNI_runNETraining(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jint jarg4, jint jarg5, jdouble jarg6, jint jarg7) {
jboolean jresult = 0 ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
CaboCha::CharsetType arg4 ;
CaboCha::PossetType arg5 ;
double arg6 ;
int arg7 ;
bool result;

(void)jenv;
(void)jcls;
arg1 = 0;
if (jarg1) {
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
if (!arg1) return 0;
}
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
arg3 = 0;
if (jarg3) {
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return 0;
}
arg4 = (CaboCha::CharsetType)jarg4;
arg5 = (CaboCha::PossetType)jarg5;
arg6 = (double)jarg6;
arg7 = (int)jarg7;
{
try {
result = (bool)CaboCha::runNETraining((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
}
catch (char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0;
};
}
catch (const char *e) {
{
SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0;
};
}
}
jresult = (jboolean)result;
if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
return jresult;
}


SWIGEXPORT jstring JNICALL Java_org_chasen_cabocha_CaboChaJNI_VERSION_1get(JNIEnv *jenv, jclass jcls) {
jstring jresult = 0 ;
char *result = 0 ;

(void)jenv;
(void)jcls;
result = (char *)("0.66");
result = (char *)("0.68");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand Down
12 changes: 12 additions & 0 deletions java/org/chasen/cabocha/CaboCha.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@ public static String getLastError() {
return CaboChaJNI.getLastError();
}

public static boolean runDependencyTraining(String train_file, String model_file, String prev_model_file, CharsetType charset, PossetType posset, double cost, int freq) {
return CaboChaJNI.runDependencyTraining(train_file, model_file, prev_model_file, charset.swigValue(), posset.swigValue(), cost, freq);
}

public static boolean runChunkingTraining(String train_file, String model_file, String prev_model_file, CharsetType charset, PossetType posset, double cost, int freq) {
return CaboChaJNI.runChunkingTraining(train_file, model_file, prev_model_file, charset.swigValue(), posset.swigValue(), cost, freq);
}

public static boolean runNETraining(String train_file, String model_file, String prev_model_file, CharsetType charset, PossetType posset, double cost, int freq) {
return CaboChaJNI.runNETraining(train_file, model_file, prev_model_file, charset.swigValue(), posset.swigValue(), cost, freq);
}

}
3 changes: 0 additions & 3 deletions java/org/chasen/cabocha/CaboChaConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,5 @@ public interface CaboChaConstants {
public final static int CABOCHA_TRAIN_CHUNK = CaboChaJNI.CABOCHA_TRAIN_CHUNK_get();
public final static int CABOCHA_TRAIN_DEP = CaboChaJNI.CABOCHA_TRAIN_DEP_get();

public final static int CABOCHA_SHIFT_REDUCE = CaboChaJNI.CABOCHA_SHIFT_REDUCE_get();
public final static int CABOCHA_TOURNAMENT = CaboChaJNI.CABOCHA_TOURNAMENT_get();

public final static String VERSION = CaboChaJNI.VERSION_get();
}
7 changes: 3 additions & 4 deletions java/org/chasen/cabocha/CaboChaJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public class CaboChaJNI {
public final static native int CABOCHA_TRAIN_NE_get();
public final static native int CABOCHA_TRAIN_CHUNK_get();
public final static native int CABOCHA_TRAIN_DEP_get();
public final static native int CABOCHA_SHIFT_REDUCE_get();
public final static native int CABOCHA_TOURNAMENT_get();
public final static native int Chunk_link_get(long jarg1, Chunk jarg1_);
public final static native int Chunk_head_pos_get(long jarg1, Chunk jarg1_);
public final static native int Chunk_func_pos_get(long jarg1, Chunk jarg1_);
Expand Down Expand Up @@ -80,8 +78,6 @@ public class CaboChaJNI {
public final static native int TRAIN_NE_get();
public final static native int TRAIN_CHUNK_get();
public final static native int TRAIN_DEP_get();
public final static native int SHIFT_REDUCE_get();
public final static native int TOURNAMENT_get();
public final static native void Tree_set_sentence(long jarg1, Tree jarg1_, String jarg2);
public final static native String Tree_sentence(long jarg1, Tree jarg1_);
public final static native long Tree_sentence_size(long jarg1, Tree jarg1_);
Expand Down Expand Up @@ -113,5 +109,8 @@ public class CaboChaJNI {
public final static native long new_Parser__SWIG_0(String jarg1);
public final static native long new_Parser__SWIG_1();
public final static native String getLastError();
public final static native boolean runDependencyTraining(String jarg1, String jarg2, String jarg3, int jarg4, int jarg5, double jarg6, int jarg7);
public final static native boolean runChunkingTraining(String jarg1, String jarg2, String jarg3, int jarg4, int jarg5, double jarg6, int jarg7);
public final static native boolean runNETraining(String jarg1, String jarg2, String jarg3, int jarg4, int jarg5, double jarg6, int jarg7);
public final static native String VERSION_get();
}
Loading

0 comments on commit 9646f9b

Please sign in to comment.