diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 8929b7a..0000000 --- a/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# Maven # -target -/fnlp-dev/target - -# IDEA # -*.iml - -# Eclipse # -.classpath -.project -.settings - -#large files# -/data -/tmp - diff --git a/fnlp-core/.classpath b/fnlp-core/.classpath index b46ac09..a4ad718 100644 --- a/fnlp-core/.classpath +++ b/fnlp-core/.classpath @@ -1,27 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fnlp-core/.settings/org.eclipse.jdt.core.prefs b/fnlp-core/.settings/org.eclipse.jdt.core.prefs index 1845056..5ac0174 100644 --- a/fnlp-core/.settings/org.eclipse.jdt.core.prefs +++ b/fnlp-core/.settings/org.eclipse.jdt.core.prefs @@ -1,17 +1,16 @@ -#Tue Mar 11 13:39:47 CST 2014 -encoding/src/test/java=UTF-8 -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -encoding/src/main/resources=UTF-8 -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -encoding/src/main/java=UTF-8 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.debug.lineNumber=generate eclipse.preferences.version=1 +encoding/src/main/java=UTF-8 +encoding/src/main/resources=UTF-8 +encoding/src/test/java=UTF-8 encoding/src/test/resources=UTF-8 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/fnlp-core/src/main/java/org/fnlp/ml/classifier/linear/Linear.java b/fnlp-core/src/main/java/org/fnlp/ml/classifier/linear/Linear.java index cf68e73..39b6724 100644 --- a/fnlp-core/src/main/java/org/fnlp/ml/classifier/linear/Linear.java +++ b/fnlp-core/src/main/java/org/fnlp/ml/classifier/linear/Linear.java @@ -108,10 +108,10 @@ public void saveTo(String file) throws IOException { public static Linear loadFrom(String file) throws LoadModelException{ Linear cl = null; try { - ObjectInputStream in = new ObjectInputStream(new GZIPInputStream( - new BufferedInputStream(new FileInputStream(file)))); - cl = (Linear) in.readObject(); - in.close(); + ObjectInputStream in = new ObjectInputStream(new GZIPInputStream( + new BufferedInputStream(Linear.class.getClassLoader().getResourceAsStream(file)))); + cl = (Linear) in.readObject(); + in.close(); } catch (Exception e) { throw new LoadModelException(e,file); } diff --git a/fnlp-core/src/main/java/org/fnlp/nlp/cn/tag/AbstractTagger.java b/fnlp-core/src/main/java/org/fnlp/nlp/cn/tag/AbstractTagger.java index 4701604..f9029d3 100644 --- a/fnlp-core/src/main/java/org/fnlp/nlp/cn/tag/AbstractTagger.java +++ b/fnlp-core/src/main/java/org/fnlp/nlp/cn/tag/AbstractTagger.java @@ -198,12 +198,12 @@ public void saveTo(String modelfile) throws IOException { } public void loadFrom(String modelfile) throws LoadModelException{ - try { - ObjectInputStream in = new ObjectInputStream(new BufferedInputStream( - new GZIPInputStream(new FileInputStream(modelfile)))); - templets = (TempletGroup) in.readObject(); - setClassifier((Linear) in.readObject()); - in.close(); + try { + ObjectInputStream in = new ObjectInputStream(new BufferedInputStream( + new GZIPInputStream(this.getClass().getClassLoader().getResourceAsStream(modelfile)))); + templets = (TempletGroup) in.readObject(); + setClassifier((Linear) in.readObject()); + in.close(); } catch (Exception e) { throw new LoadModelException(e,modelfile); } diff --git a/fnlp-dev/.classpath b/fnlp-dev/.classpath index c9464c0..a67b19b 100644 --- a/fnlp-dev/.classpath +++ b/fnlp-dev/.classpath @@ -1,26 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/fnlp-dev/.settings/org.eclipse.jdt.core.prefs b/fnlp-dev/.settings/org.eclipse.jdt.core.prefs index 7d4cc82..7bd84e7 100644 --- a/fnlp-dev/.settings/org.eclipse.jdt.core.prefs +++ b/fnlp-dev/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,12 @@ -#Tue Mar 11 13:39:47 CST 2014 -encoding/src/test/java=UTF-8 -org.eclipse.jdt.core.compiler.compliance=1.6 -encoding/src/main/resources=UTF-8 -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -encoding/src/main/java=UTF-8 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 eclipse.preferences.version=1 +encoding/src/main/java=UTF-8 +encoding/src/main/resources=UTF-8 +encoding/src/test/java=UTF-8 encoding/src/test/resources=UTF-8 -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/fnlp-dev/pom.xml b/fnlp-dev/pom.xml index 906f3b9..da4eec4 100644 --- a/fnlp-dev/pom.xml +++ b/fnlp-dev/pom.xml @@ -24,7 +24,7 @@ org.fnlp fnlp-core - 2.1-SNAPSHOT + 2.1-SNAPSHOT-gubnoi-v5 diff --git a/fnlp-train/.classpath b/fnlp-train/.classpath index f94f9d9..6e58653 100644 --- a/fnlp-train/.classpath +++ b/fnlp-train/.classpath @@ -1,26 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/fnlp-train/.settings/org.eclipse.jdt.core.prefs b/fnlp-train/.settings/org.eclipse.jdt.core.prefs index 107056a..672496e 100644 --- a/fnlp-train/.settings/org.eclipse.jdt.core.prefs +++ b/fnlp-train/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,12 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/fnlp-train/pom.xml b/fnlp-train/pom.xml index 566eb05..c71c1fb 100644 --- a/fnlp-train/pom.xml +++ b/fnlp-train/pom.xml @@ -24,7 +24,7 @@ org.fnlp fnlp-core - 2.1-SNAPSHOT + 2.1-SNAPSHOT-gubnoi-v5