Search in sources :

Example 1 with EasyDictionary

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

the class TestDictionaryMaker method testLoadEasyDictionary.

public void testLoadEasyDictionary() throws Exception {
    EasyDictionary dictionary = EasyDictionary.create("data/2014_dictionary.txt");
    System.out.println(dictionary.GetWordInfo("高峰"));
}
Also used : EasyDictionary(com.hankcs.hanlp.corpus.dictionary.EasyDictionary)

Example 2 with EasyDictionary

use of com.hankcs.hanlp.corpus.dictionary.EasyDictionary 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)2 NTDictionaryMaker (com.hankcs.hanlp.corpus.dictionary.NTDictionaryMaker)1 CorpusLoader (com.hankcs.hanlp.corpus.document.CorpusLoader)1 Document (com.hankcs.hanlp.corpus.document.Document)1