Arithmetic Operators

Hyperspace allows arithmetic operations between scores, using the operators +, *, -, / . These operators can be used in combination with the operator =

Example

def score_function(params, doc):
   score0 = 0.0
   score1 = 0.0
   if (match("field 1") or match("field2") or match("Expiration date")):
      score0 += rarity_max("visit_times_in_personal care")
      score0 -= rarity_sum("Credit card")
   score1 = 2 * score0
return score1

Where-

score0 is the result of a score function.

Last updated