当前位置: 首页>>代码示例>>Java>>正文


Java Parameters.get方法代码示例

本文整理汇总了Java中org.galagosearch.tupleflow.Parameters.get方法的典型用法代码示例。如果您正苦于以下问题:Java Parameters.get方法的具体用法?Java Parameters.get怎么用?Java Parameters.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.galagosearch.tupleflow.Parameters的用法示例。


在下文中一共展示了Parameters.get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFeatureClassName

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public String getFeatureClassName(Parameters parameters) throws Exception {
    if (parameters.containsKey("class")) {
        return parameters.get("class");
    }

    String name = parameters.get("name", parameters.get("default", (String) null));

    if (name == null) {
        throw new Exception(
                "Didn't find 'class', 'name', or 'default' parameter in this feature description.");
    }

    OperatorSpec operatorType = featureLookup.get(name);

    if (operatorType == null) {
        throw new Exception("Couldn't find a class for the feature named " + name + ".");
    }

    return operatorType.className;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:21,代码来源:FeatureFactory.java

示例2: handleBuild

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
private static void handleBuild(String[] args) throws Exception {
    if (args.length <= 1) {
        commandHelpBuild();
        return;
    }

    // handle --links and --stemming flags
    String[][] filtered = Utility.filterFlags(Utility.subarray(args, 2));

    String[] flags = filtered[0];
    String[] docs = filtered[1];

    Parameters p = new Parameters(flags);
    boolean useLinks = p.get("links", false);
    boolean stemming = p.get("stemming", true);

    BuildIndex build = new BuildIndex();
    Job job = build.getIndexJob(args[1], docs, useLinks, stemming);
    ErrorStore store = new ErrorStore();
    JobExecutor.runLocally(job, store);
    if (store.hasStatements()) {
        System.out.println(store.toString());
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:25,代码来源:App.java

示例3: DirichletScorer

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public DirichletScorer(Parameters parameters, CountIterator iterator) throws IOException {
    super(iterator);

    mu = parameters.get("mu", 1500);
    if (parameters.containsKey("collectionProbability")) {
        background = parameters.get("collectionProbability", 0.0001);
    } else {
        long collectionLength = parameters.get("collectionLength", (long)0);
        long count = 0;
        
        while (!iterator.isDone()) {
            count += iterator.count();
            iterator.nextDocument();
        }
        
        background = (double)count / (double)collectionLength;
        iterator.reset();
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:20,代码来源:DirichletScorer.java

示例4: UnorderedWindowIterator

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
/** Creates a new instance of UnorderedWindowIterator */
public UnorderedWindowIterator(Parameters parameters, ExtentIterator[] extentIterators) throws IOException {
    super(extentIterators);
    this.width = (int) parameters.getAsDefault("width", -1);
    this.overlap = parameters.get("overlap", false);
    findDocument();
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:8,代码来源:UnorderedWindowIterator.java

示例5: stemmedNode

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
private Node stemmedNode(Node original) {
    Parameters parameters = original.getParameters().clone();
    parameters.add("part", "stemmedPostings");
    String term = parameters.get("default");
    stemmer.setCurrent(term);
    stemmer.stem();
    String stemmed = stemmer.getCurrent();
    parameters.set("default", stemmed);
    return new Node("extents", parameters, original.getInternalNodes(), original.getPosition());
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:11,代码来源:TextFieldRewriteTraversal.java

示例6: IndexWriter

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
/**
 * Creates a new instance of IndexWriter
 */
public IndexWriter(String outputFilename, Parameters parameters)
        throws FileNotFoundException, IOException {
    // Create the parent directory:
    new File(outputFilename).getParentFile().mkdirs();

    blockSize = (int) parameters.get("blockSize", 32768);
    isCompressed = parameters.get("isCompressed", false);
    output = new DataOutputStream(new BufferedOutputStream(
                                  new FileOutputStream(outputFilename)));
    vocabulary = new VocabularyWriter();
    manifest = new Parameters();
    manifest.copy(parameters);
    lists = new ArrayList<IndexElement>();
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:18,代码来源:IndexWriter.java

示例7: getIdentifier

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public String getIdentifier(Parameters parameters, String fileName) {
    String idType = parameters.get("identifier", "filename");
    if (idType.equals("filename")) {
        return fileName;
    } else {
        String id = stripExtensions(fileName);
        id = new File(id).getName();
        return id;
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:11,代码来源:FileParser.java

示例8: parseQuery

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public static Node parseQuery(String query, Parameters parameters) {
    String queryType = parameters.get("queryType", "complex");

    if (queryType.equals("simple")) {
        return SimpleQuery.parseTree(query);
    }

    return StructuredQuery.parse(query);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:Search.java

示例9: main

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    // read in parameters
    Parameters parameters = new Parameters(args);
    List<Parameters.Value> queries = parameters.list("query");

    // open index
    Retrieval retrieval = Retrieval.instance(parameters.get("index"), parameters);

    // record results requested
    int requested = (int) parameters.get("count", 1000);

    // for each query, run it, get the results, look up the docnos, print in TREC format
    for (Parameters.Value query : queries) {
        // parse the query
        String queryText = query.get("text");
        Node queryRoot = parseQuery(queryText, parameters);

        ScoredDocument[] results = retrieval.runQuery(queryRoot, requested);

        for (int i = 0; i < results.length; i++) {
            String document = retrieval.getDocumentName(results[i].document);
            double score = results[i].score;
            int rank = i + 1;

            System.out.format("%s Q0 %s %d %s galago\n", query.get("number"), document, rank,
                              formatScore(score));
        }
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:30,代码来源:BatchSearch.java

示例10: ScaleIterator

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public ScaleIterator(Parameters parameters, ScoreIterator iterator) throws IllegalArgumentException {
    this.iterator = iterator;
    weight = parameters.get("weight", 1.0);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:5,代码来源:ScaleIterator.java

示例11: SQLDocumentStore

import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public SQLDocumentStore(Parameters parameters) throws SQLException, ClassNotFoundException {
    this(parameters.get("driverName"), parameters.get("databaseUrl"));
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:4,代码来源:SQLDocumentStore.java


注:本文中的org.galagosearch.tupleflow.Parameters.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。