Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用indri在java中编制索引?_Java_Indri - Fatal编程技术网

如何使用indri在java中编制索引?

如何使用indri在java中编制索引?,java,indri,Java,Indri,在myindex变量中,我提供了IndexUI.jar文件的路径。 我是新来的。我不太清楚它的用法。我已经下载了indri 5.9问题是indri的版本 import lemurproject.indri.*; import java.io.*; public class Indritest { public static void main(String[] args) throws Exception { String [] stopWordList = {"

myindex
变量中,我提供了
IndexUI.jar
文件的路径。
我是新来的。我不太清楚它的用法。我已经下载了indri 5.9

问题是indri的版本

import lemurproject.indri.*;
import java.io.*;

public class Indritest {

    public static void main(String[] args) throws Exception {

        String [] stopWordList =  {"a", "an", "and", "are", "as", "at", "be", 
                                  "by","for", "from", "has", "he", "in", "is",
                                  "it", "its", "of", "on", "that", "the", "to",
                                  "was", "were", "will", "with"};

        String myIndex = "C:/Program Files/lemur/lemur4.12/src/app/obj/myIndex5";

        try {
            IndexEnvironment envI = new IndexEnvironment();
            envI.setStoreDocs(true);

            // create an Indri repository
            envI.setMemory(256000000);

            envI.setStemmer("krovetz");
            envI.setStopwords(stopWordList);

            envI.setIndexedFields( new String[] {"article", "header", "p", "title", "link"}); 
            envI.open(myIndex);
            envI.create( myIndex );

            // add xml files to the just created index i.e myIndex
            // xml_data is a folder which contains the list of xml files to be added

            File filesDir = new File("C:/NetbeanProg2/xml_data"); 
            File[] files = filesDir.listFiles(); 
            int noOffiles = files.length; 
            for (int i = 0; i < noOffiles; i++) { 
                System.out.println(files[i].getCanonicalPath() + "\t" + files[i].getCanonicalFile()); 
                envI.addFile(files[i].getCanonicalPath(), "xml"); 
            }  
        } catch (Exception e) {
            System.out.println("issue is: " + e);
        }
    }
}
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\Indri\Indri 5.9\bin\indri_jni.dll: Can't find dependent libraries