class_docstr: An accumulator object capable of computing BLEU score using multiple references.
  The BLEU score is always smoothed a bit so that it's never undefined. For sentence-level
  measurements, proper smoothing should be used via the smoothing parameter (set to 1.0 for
  the same behavior as default Moses's MERT sentence BLEU).
docstr: Append a sentence for measurements, increase counters.
  @param pred_sent: the system output sentence (string/list of tokens)
  @param ref_sents: the corresponding reference sentences (list of strings/lists of tokens)
docstr_tok: ["Append","a","sentence","for","measurements",",","increase","counters",".","@","param","pred_sent",":","the","system","output","sentence","(","string\/list","of","tokens",")","@","param","ref_sents",":","the","corresponding","reference","sentences","(","list","of","strings\/lists","of","tokens",")"]
code: def append(self, pred_sent, ref_sents):
      """Append a sentence for measurements, increase counters.
      @param pred_sent: the system output sentence (string/list of tokens)
      @param ref_sents: the corresponding reference sentences (list of strings/lists of tokens)
      """
      pred_sent, ref_sents = self.check_tokenized(pred_sent, ref_sents)
  
      # compute n-gram matches
      for i in range(self.max_ngram):
          self.hits[i] += self.compute_hits(i + 1, pred_sent, ref_sents)
          self.cand_lens[i] += len(pred_sent) - i
  
      # take the reference that is closest in length to the candidate
      # (if there are two of the same distance, take the shorter one)
      closest_ref = min(
          ref_sents,
          key=lambda ref_sent: (
              abs(len(ref_sent) - len(pred_sent)),
              len(ref_sent),
          ),
      )
      self.ref_len += len(closest_ref)
  
imports: from __future__ import unicode_literals
  from __future__ import division
  from builtins import zip
  from builtins import range
  from past.utils import old_div
  from builtins import object
  from collections import defaultdict
  import math
  import re
label_desc: Use image node_id 3 for calling the BLEUScore obj's underlying member method code with example usage: obj.append(pred_sent, ref_sents) without return types