返回有序集 key 中，所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。
有序集成员按 score 值递增(从小到大)次序排列。
343356
@SuppressWarnings("rawtypes")
	public Set zrangeByScore(Object key, double min, double max) {
		Jedis jedis = getJedis();
		try {
			Set<byte[]> data = jedis.zrangeByScore(keyToBytes(key), min, max);
			Set<Object> result = new LinkedHashSet<Object>();	// 有序集合必须 LinkedHashSet
			valueSetFromBytesSet(data, result);
			return result;
		}
		finally {close(jedis);}
	}
536183
public AdamicAdar<K, VV, EV> setMinimumScore(float score) {
		Preconditions.checkArgument(score >= 0, "Minimum score must be non-negative");

		this.minimumScore = score;

		return this;
	}
697952
def retrieve_with_score(self, s):
        
        all_sim = []
        use_max_n = self.max_n is not None
        for comparison_string in self._get_comparison_strings(s):
            score = self.comparison_func(s, comparison_string)
            if score >= self.cutoff:
                all_sim.append((comparison_string, score))
                if use_max_n and len(all_sim) >= self.max_n:
                    return all_sim
        return all_sim
933539
public Double zincrby(Object key, double score, Object member) {
		Jedis jedis = getJedis();
		try {
			return jedis.zincrby(keyToBytes(key), score, valueToBytes(member));
		}
		finally {close(jedis);}
	}
95659
public String nonPipelineZRANGE(String key, int max_score) {
        StringBuilder sb = new StringBuilder();
        // Return all elements
        Set<String> returnEntries = this.jedisClient.get().zrange(key, 0, -1);
        if (returnEntries.isEmpty()) {
            logger.error("The number of entries in the sorted set are less than the number of entries written");
            return null;
        }

        returnEntries.forEach(sb::append);
        return sb.toString();
    }
923930
@Override
    protected double scoreImpl(List<Word> words1, List<Word> words2) {
        //用词频来标注词的权重
        taggingWeightWithWordFrequency(words1, words2);
        //构造权重快速搜索容器
        Map<String, Float> weights1 = toFastSearchMap(words1);
        Map<String, Float> weights2 = toFastSearchMap(words2);
        //所有的不重复词
        Set<Word> words = new HashSet<>();
        words.addAll(words1);
        words.addAll(words2);
        //向量的维度为words的大小，每一个维度的权重是词频
        //a.b
        AtomicFloat ab = new AtomicFloat();
        //|a|的平方
        AtomicFloat aa = new AtomicFloat();
        //|b|的平方
        AtomicFloat bb = new AtomicFloat();
        //计算
        words
            .parallelStream()
            .forEach(word -> {
                Float x1 = weights1.get(word.getText());
                Float x2 = weights2.get(word.getText());
                if (x1 != null && x2 != null) {
                    //x1x2
                    float oneOfTheDimension = x1 * x2;
                    //+
                    ab.addAndGet(oneOfTheDimension);
                }
                if (x1 != null) {
                    //(x1)^2
                    float oneOfTheDimension = x1 * x1;
                    //+
                    aa.addAndGet(oneOfTheDimension);
                }
                if (x2 != null) {
                    //(x2)^2
                    float oneOfTheDimension = x2 * x2;
                    //+
                    bb.addAndGet(oneOfTheDimension);
                }
            });
        //|a|
        double aaa = Math.sqrt(aa.doubleValue());
        //|b|
        double bbb = Math.sqrt(bb.doubleValue());
        //使用BigDecimal保证精确计算浮点数
        //|a|*|b|
        //double aabb = aaa * bbb;
        BigDecimal aabb = BigDecimal.valueOf(aaa).multiply(BigDecimal.valueOf(bbb));
        //similarity=a.b/|a|*|b|
        //double cos = ab.get() / aabb.doubleValue();
        double cos = BigDecimal.valueOf(ab.get()).divide(aabb, 9, BigDecimal.ROUND_HALF_UP).doubleValue();
        return cos;
    }
1246848
public int build(List<String> _key, int _length[], int _value[],
                     int _keySize)
    {
        if (_key == null || _keySize > _key.size())
            return 0;

        // progress_func_ = progress_func;
        key = _key;
        length = _length;
        keySize = _keySize;
        value = _value;
        progress = 0;
        allocSize = 0;

        resize(65536 * 32); // 32个双字节

        base[0] = 1;
        nextCheckPos = 0;

        Node root_node = new Node();
        root_node.left = 0;
        root_node.right = keySize;
        root_node.depth = 0;

        List<Node> siblings = new ArrayList<Node>();
        fetch(root_node, siblings);
        insert(siblings, new BitSet());
        shrink();

        // size += (1 << 8 * 2) + 1; // ???
        // if (size >= allocSize) resize (size);

        key = null;
        length = null;

        return error_;
    }
262803
private int minimumFnRemove(int[] h) {
    int minIndex = Integer.MAX_VALUE;
    double minValue = Double.MAX_VALUE;

    for (int i = 0; i < nbHash; i++) {
      double keyWeight = getWeight(keyVector[h[i]]);

      if (keyWeight < minValue) {
        minIndex = h[i];
        minValue = keyWeight;
      }

    }

    return minIndex;
  }
881540
def count_between(self, min_score=None, max_score=None):
        
        min_score = float('-inf') if min_score is None else float(min_score)
        max_score = float('inf') if max_score is None else float(max_score)

        return self.redis.zcount(self.key, min_score, max_score)
289617
def get(self, key):
        ''''''
        if key in self and len(self[key]) > 0:
            return min(self[key])
        else:
            return 0
978159
public function zRangeByScore($key, $min = 0, $max = -1, $withScores = false, $offset = null, $count = null) {
        $payload = ['zrangebyscore', $key, $min, $max];

        if ($withScores) {
            $payload[] = 'WITHSCORES';
        }

        if ($offset !== null && $count !== null) {
            $payload[] = 'LIMIT';
            $payload[] = $offset;
            $payload[] = $count;
        }

        return $this->send($payload, function ($response) use ($withScores) {
            if ($withScores) {
                $result = [];

                for ($i = 0, $count = \count($response); $i < $count; $i += 2) {
                    $result[$response[$i]] = $response[$i + 1];
                }

                return $result;
            }

            return $response;
        });
    }
529026
def _score(cluster):
    
    x, y = zip(*cluster)[:2]
    return min(len(set(x)), len(set(y)))
257189
void score(final List<Integer> attributes,
               List<Double> retval)
    {
        Map <Integer,Integer >   encoder = precomputation_id_encoder;
        // arma.vec hidden_layer = arma.zeros<arma.vec>(hidden_layer_size);
        Matrix hidden_layer = Matrix.zero(hidden_layer_size, 1);

        for (int i = 0, off = 0; i < attributes.size(); ++i, off += embedding_size)
        {
            int aid = attributes.get(i);
            int fid = aid * nr_feature_types + i;
            Integer rep = encoder.get(fid);
            if (rep != null)
            {
                hidden_layer.plusEquals(saved.col(rep));
            }
            else
            {
                // 使用向量而不是特征本身
                // W1[0:hidden_layer, off:off+embedding_size] * E[fid:]'
                hidden_layer.plusEquals(W1.block(0, off, hidden_layer_size, embedding_size).times(E.col(aid)));
            }
        }

        hidden_layer.plusEquals(b1);    // 加上偏置

        Matrix output = W2.times(new Matrix (hidden_layer.cube())); // 立方激活函数
//        retval.resize(nr_classes, 0.);
        retval.clear();
        for (int i = 0; i < nr_classes; ++i)
        {
            retval.add(output.get(i, 0));
        }
    }
536178
public function zrangebyscore($key, $min, $max, $options = [])
    {
        if (isset($options['limit'])) {
            $options['limit'] = [
                $options['limit']['offset'],
                $options['limit']['count'],
            ];
        }

        return $this->command('zRangeByScore', [$key, $min, $max, $options]);
    }
382166
@Override
    protected double scoreImpl(List<Word> words1, List<Word> words2){
        //文本1
        StringBuilder text1 = new StringBuilder();
        words1.forEach(word -> text1.append(word.getText()));
        //文本2
        StringBuilder text2 = new StringBuilder();
        words2.forEach(word -> text2.append(word.getText()));
        //计算文本1和文本2的Jaro距离
        //Jaro距离也就是相似度分值
        double score = jaroDistance(text1.toString(), text2.toString());
        if(LOGGER.isDebugEnabled()){
            LOGGER.debug("文本1："+text1.toString());
            LOGGER.debug("文本2："+text2.toString());
            LOGGER.debug("文本1和文本2的相似度分值："+score);
        }
        return score;
    }
1087066
def lt(self, v, limit=None, offset=None):
        
        if limit is not None and offset is None:
            offset = 0
        return self.zrangebyscore(self._min_score, "(%f" % v,
                start=offset, num=limit)
191626
function calculateNodeScore (node, candidates) {
  const txt = node.text()
  let contentScore = 1

  // Ignore too small nodes
  if (txt.length < 25) {
    return
  }

  // Add points for any commas within this paragraph support Chinese commas
  const commas = txt.match(/[,，.。;；?？、]/g)
  if (commas && commas.length) {
    contentScore += commas.length
  }

  // For every 100 characters in this paragraph, add another point. Up to 3 points.
  contentScore += Math.min(Math.floor(txt.length / 100), 3)

  // If it has an article parent
  if (node.closest('article')) {
    contentScore += 25
  }

  // Initialize Parent and Grandparent
  // First initialize the parent node with contentScore / 1, then grandParentNode with contentScore / 2
  const parent = node.parent()

  if (parent && parent.length > 0) {
    scoreCandidate(parent, contentScore, candidates)
    const grandParent = parent.parent()
    if (grandParent && grandParent.length > 0) {
      scoreCandidate(grandParent, contentScore / 2, candidates)
    }
  }
}