Skip to content

Commit

Permalink
add default constructor using inner resource model
Browse files Browse the repository at this point in the history
  • Loading branch information
shin285 committed May 2, 2017
1 parent 9d88051 commit 0a8480f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/main/java/kr/co/shineware/nlp/komoran/core/Komoran.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
import kr.co.shineware.util.common.model.Pair;
import kr.co.shineware.util.common.string.StringUtil;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.*;
import java.lang.Character.UnicodeBlock;
import java.util.*;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -71,6 +68,13 @@ public Komoran(String modelPath){
this.unitParser = new KoreanUnitParser();
}

public Komoran(){
this.resources = new Resources();
File file = new File(getClass().getClassLoader().getResource("models_full").getFile());
this.load(file.getAbsolutePath());
this.unitParser = new KoreanUnitParser();
}

public void analyzeTextFile(String inputFilename, String outputFilename, int thread){

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class KomoranTest {

@Before
public void init() throws Exception {
this.komoran = new Komoran("models_full");
// this.komoran = new Komoran("models_full");
this.komoran = new Komoran();
}

@Test
Expand Down

0 comments on commit 0a8480f

Please sign in to comment.