gigaZhang / mmseg4j

Automatically exported from code.google.com/p/mmseg4j
Apache License 2.0
0 stars 0 forks source link

mmseg4j-1.9.1-snapshot mmseg4j-solr MMSegTokenizerFactory异常 #50

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
MMSeg没有reset

直接上代码:
public class MMSegTokenizerFactory extends TokenizerFactory implements 
ResourceLoaderAware {

    public Tokenizer create(Reader input) {
        MMSegTokenizer tokenizer = tokenizerLocal.get();
        if(tokenizer == null) {
            tokenizer = newTokenizer(input);
        } else {
            try {
                tokenizer.setReader(input);
                                //此处应该reset,加上这行代码就修掉bug
                                tokenizer.reset();
            } catch (IOException e) {
                tokenizer = newTokenizer(input);
                log.info("MMSegTokenizer.reset i/o error by:"+e.getMessage());
            }
        }

        return tokenizer;
    }
......
}

Original issue reported on code.google.com by yangchao...@gmail.com on 22 Mar 2013 at 9:03

GoogleCodeExporter commented 8 years ago
使用 2.0.0

参考 https://github.com/chenlb/mmseg4j-solr

Original comment by chenlb2...@gmail.com on 19 May 2014 at 11:34