class_docstr: list of beams at specific time-step
docstr: complete beams such that last word is complete word
docstr_tok: ["complete","beams","such","that","last","word","is","complete","word"]
code: def completeBeams(self, lm):
      "complete beams such that last word is complete word"
      for _, v in self.beams.items():
          lastPrefix = v.textual.wordDev
          if lastPrefix == "" or lm.isWord(lastPrefix):
              continue
  
          # get word candidates for this prefix
          words = lm.getNextWords(lastPrefix)
          # if there is just one candidate, then the last prefix can be extended to
          if len(words) == 1:
              word = words[0]
              v.textual.text += word[len(lastPrefix) - len(word) :]
  
imports: from __future__ import division
  from __future__ import print_function
  import copy
label_desc: Use image node_id 5 for calling the BeamList obj's underlying member method code with example usage: obj.completeBeams(lm) without return types