【问题标题】:Error Terrier Java in eclipse with java sample code带有 java 示例代码的 Eclipse 中的 Error Terrier Java
【发布时间】:2017-11-21 23:57:43
【问题描述】:

大家好,

我浏览了 terrier 快速入门教程语料库,然后运行以下代码:

import java.util.Arrays;
import org.terrier.indexing.Collection;
import org.terrier.indexing.SimpleFileCollection;
import org.terrier.structures.indexing.Indexer;
import org.terrier.structures.indexing.classical.BasicIndexer;
import org.terrier.utility.ApplicationSetup;

public class IndexingExample {

    public static void main(String[] args) throws Exception {
        // TODO Auto-generated method stub

        // Directory containing files to index
            String aDirectoryToIndex = "/home/nadhem/PFE/terrier-core-4.2/share/vaswani_npl/corpus/";

        // Configure Terrier
            ApplicationSetup.setProperty("terrier.home", "/home/nadhem/PFE/terrier-core-4.2"); 

            Indexer indexer = new BasicIndexer("/home/nadhem/PFE/terrier-core-4.2/var/index", "data");
            Collection coll = new SimpleFileCollection(Arrays.asList(aDirectoryToIndex), true);
            indexer.index(new Collection[]{coll});
    }

}

我收到以下错误:

警告:在 /etc/terrier.properties 位置找不到文件 terrier.properties 假设 terrier.home 的值来自相应的系统属性。 请确保在文件 terrier.properties 中指定属性 terrier.home,或在命令行中指定为系统属性。

我不明白为什么尽管检查了属性文件却找不到...还有一个

任何帮助将不胜感激。

谢谢, 纳德曼诺维奇

【问题讨论】:

    标签: java information-retrieval corpus eclipse-oxygen


    【解决方案1】:

    我通过提供 terrier.home 作为 VM 参数解决了这个问题。

    单击运行方式,然后单击运行配置。您可以在 VM Arguments 框中的 Arguments 选项卡中更改传递给 JVM 的参数。

    -Dterrier.home=/home/nadhem/PFE/terrier-core-4.2
    

    希望这能解决您的问题。

    【讨论】:

      猜你喜欢
      • 2014-01-02
      • 1970-01-01
      • 1970-01-01
      • 2011-08-06
      • 2012-03-30
      • 2021-05-19
      • 1970-01-01
      • 1970-01-01
      • 2012-05-03
      相关资源
      最近更新 更多