class_docstr: Bleu scorer.
class_docstr_tok: ["Bleu","scorer","."]
code: def _single_reflen(self, reflens, option=None, testlen=None):
      if option == "shortest":
          reflen = min(reflens)
      elif option == "average":
          reflen = float(sum(reflens)) / len(reflens)
      elif option == "closest":
          reflen = min((abs(l - testlen), l) for l in reflens)[1]
      else:
          raise ValueError("unsupported reflen option %s" % option)
  
      return reflen
  
imports: import copy
  import math
  from builtins import dict, range
  from collections import defaultdict
label_desc: Use image node_id 15 for calling the BleuScorer obj's underlying member method code with example usage: obj._single_reflen(reflens, option, testlen) and returns: reflen