Examples of KeyValuePair


Examples of com.trendmicro.mist.proto.MistMessage.KeyValuePair

   
    @Override
    public void postReceive(ConsumerSession.MessagePrepared msg) throws MistException {
        Iterator<KeyValuePair> iter = msg.builder.getPropertiesList().iterator();
        while(iter.hasNext()) {
            KeyValuePair kv = iter.next();
            if(kv.getKey().equals(GOC_REF)) {
                String ref = kv.getValue();
               
                HttpURLConnection conn = null;
                try {
                    conn = (HttpURLConnection) new URL(ref).openConnection();
                    conn.setDoInput(true);
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

          fbWeight += docProb;
        }
       
        fbWeight /= (double)fbDocVectors.size();
       
        KeyValuePair tuple = new KeyValuePair(term, fbWeight);
        features.add(tuple);
      }
     
     
     
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

    Iterator<KeyValuePair> it = kvpList.iterator();

    Map<String,Double> newMap = new HashMap<String,Double>(k);
    int i=0;
    while(it.hasNext()) {
      KeyValuePair kvp = it.next();
      newMap.put((String)kvp.getKey(), kvp.getScore());
      if(i++ > k)
        break;
    }

    features = (HashMap<String, Double>) newMap;
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

    List<KeyValuePair> kvpList = new ArrayList<KeyValuePair>(features.size());
    Iterator<String> featureIterator = features.keySet().iterator();
    while(featureIterator.hasNext()) {
      String feature = featureIterator.next();
      double value   = features.get(feature);
      KeyValuePair keyValuePair = new KeyValuePair(feature, value);
      kvpList.add(keyValuePair);
    }
    ScorableComparator comparator = new ScorableComparator(true);
    Collections.sort(kvpList, comparator);
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

    StringBuilder b = new StringBuilder();
    List<KeyValuePair> kvpList = getOrderedFeatures();
    Iterator<KeyValuePair> it = kvpList.iterator();
    int i=0;
    while(it.hasNext() && i++ < k) {
      KeyValuePair pair = it.next();
      b.append(format.format(pair.getScore()) + " " + pair.getKey() + "\n");
    }
    return b.toString();

  }
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

    Collections.sort(features, comparator);
    Iterator<KeyValuePair> it = features.iterator();
   
    int i=0;
    while(it.hasNext() && i++ < fbTermCount) {     
      KeyValuePair tuple = it.next();
      finalVector.addTerm(tuple.getKey(), tuple.getScore());
    }
   
    newQuery.setFeatureVector(finalVector);
   
    return newQuery;
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

  public FeatureVector asFeatureVector() {
    FeatureVector f = new FeatureVector(stopper);
    Iterator<KeyValuePair> it = features.iterator();
   
    while(it.hasNext()) {     
      KeyValuePair tuple = it.next();
      f.addTerm(tuple.getKey(), tuple.getScore());
   
   
    return f;
  }
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

 
  public Map<String,Double> asMap() {
    Map<String,Double> map = new HashMap<String,Double>(features.size());
    Iterator<KeyValuePair> it = features.iterator();
    while(it.hasNext()) {
      KeyValuePair tuple = it.next();
      map.put(tuple.getKey(), tuple.getScore());
    }

    return map;
  }
View Full Code Here

Examples of edu.illinois.lis.utils.KeyValuePair

   
    StringBuilder b = new StringBuilder();
    it = features.iterator();
    i=0;
    while(it.hasNext() && i++ < k) {     
      KeyValuePair tuple = it.next();
      b.append(format.format(tuple.getScore()/sum) + " " + tuple.getKey() + "\n");
    }
   
    return b.toString();
  }
View Full Code Here

Examples of fi.luomus.commons.containers.KeyValuePair

    }
    return map;
  }
 
  public static KeyValuePair pair(String key, String value) {
    return new KeyValuePair(key, value);
  }
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.