Search in sources :

Example 1 with NTDictionaryMaker

use of com.hankcs.hanlp.corpus.dictionary.NTDictionaryMaker in project HanLP by hankcs.

the class TestMakeCompanyCorpus method testParse.

public void testParse() throws Exception {
    EasyDictionary dictionary = EasyDictionary.create("data/dictionary/2014_dictionary.txt");
    final NTDictionaryMaker nsDictionaryMaker = new NTDictionaryMaker(dictionary);
    // CorpusLoader.walk("D:\\JavaProjects\\CorpusToolBox\\data\\2014\\", new CorpusLoader.Handler()
    CorpusLoader.walk("data/test/nt/part/", new CorpusLoader.Handler() {

        @Override
        public void handle(Document document) {
            nsDictionaryMaker.compute(document.getComplexSentenceList());
        }
    });
    nsDictionaryMaker.saveTxtTo("D:\\JavaProjects\\HanLP\\data\\dictionary\\organization\\outerNT");
}
Also used : EasyDictionary(com.hankcs.hanlp.corpus.dictionary.EasyDictionary) CorpusLoader(com.hankcs.hanlp.corpus.document.CorpusLoader) NTDictionaryMaker(com.hankcs.hanlp.corpus.dictionary.NTDictionaryMaker) Document(com.hankcs.hanlp.corpus.document.Document)

Aggregations

EasyDictionary (com.hankcs.hanlp.corpus.dictionary.EasyDictionary)1 NTDictionaryMaker (com.hankcs.hanlp.corpus.dictionary.NTDictionaryMaker)1 CorpusLoader (com.hankcs.hanlp.corpus.document.CorpusLoader)1 Document (com.hankcs.hanlp.corpus.document.Document)1