'Koreananalyzer'에 해당되는 글 1건

  1. 2013.01.24 루씬 한국어형태소 분석기 lucene-core 3.2 에서 3.6 으로..

루씬 한국어형태소 분석기 lucene-core 3.2 에서 3.6 으로..

Elastic/Elasticsearch 2013. 1. 24. 16:03

lucene kr analyzer 사용 시 lucene core 3.2 에서 3.6 으로 올리시게 되면 아래 클래스에서 빨갱이가 나옵니다.
아래는 수정한 코드 인데 뭐 보시면 너무나 기본이라 이런건 작성할 필요가 있는지도 ^^;
암튼 머리 나쁜 저는 필요 해서.. 

[KoreanAnalyzer.java]

 /** Builds an analyzer with the stop words from the given file.

   * @see WordlistLoader#getWordSet(File)

   */

public KoreanAnalyzer(Version matchVersion, File stopwords) throws IOException {     

        this(matchVersion, WordlistLoader.getWordSet(new InputStreamReader(new FileInputStream(stopwords), DIC_ENCODING), matchVersion));        

}


  /** Builds an analyzer with the stop words from the given file.

   * @see WordlistLoader#getWordSet(File)

   */

public KoreanAnalyzer(Version matchVersion, File stopwords, String encoding) throws IOException {

        this(matchVersion, WordlistLoader.getWordSet(new InputStreamReader(new FileInputStream(stopwords), encoding), matchVersion));

}

/** Builds an analyzer with the stop words from the given reader.

* @see WordlistLoader#getWordSet(Reader)

*/

public KoreanAnalyzer(Version matchVersion, Reader stopwords) throws IOException {

  this(matchVersion, WordlistLoader.getWordSet(stopwords, matchVersion));    

}

기존 KoreanAnalyzer 에는 Version argument 가 없어서 추가만 했습니다. :)

: