Examples of CNFactory


Examples of org.fnlp.nlp.cn.CNFactory

    String indexPath = "../tmp/lucene";
    System.out.println("Index directory '" + indexPath);
    Date start = new Date();
    Directory dir = FSDirectory.open(new File(indexPath));
    //需要先初始化 CNFactory
    CNFactory factory = CNFactory.getInstance("../models",Models.SEG_TAG);
    Analyzer analyzer = new FNLPAnalyzer(Version.LUCENE_47);
    // Now search the index:
    DirectoryReader ireader = DirectoryReader.open(dir);
    IndexSearcher isearcher = new IndexSearcher(ireader);
    // Parse a simple query that searches for "text":
View Full Code Here

Examples of org.fnlp.nlp.cn.CNFactory

    String indexPath = "../tmp/lucene";
    System.out.println("Indexing to directory '" + indexPath  + "'...");
    Date start = new Date();
    Directory dir = FSDirectory.open(new File(indexPath));//Dirctory dir-->FSDirectory
    //需要先初始化 CNFactory
    CNFactory factory = CNFactory.getInstance("../models",Models.SEG_TAG);
    Analyzer analyzer = new FNLPAnalyzer(Version.LUCENE_47);
    IndexWriterConfig iwc = new IndexWriterConfig(Version.LUCENE_47, analyzer);
    iwc.setOpenMode(OpenMode.CREATE_OR_APPEND);
    IndexWriter writer = new IndexWriter(dir, iwc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.