class_docstr: prefix tree
docstr: get all words of which given text is a prefix (including the text itself, it is a word)
docstr_tok: ["get","all","words","of","which","given","text","is","a","prefix","(","including","the","text","itself",",","it","is","a","word",")"]
code: def getNextWords(self, text):
      "get all words of which given text is a prefix (including the text itself, it is a word)"
      words = []
      node = self.getNode(text)
      if node:
          nodes = [node]
          prefixes = [text]
          while len(nodes) > 0:
              # put all children into list
              for k, v in nodes[0].children.items():
                  nodes.append(v)
                  prefixes.append(prefixes[0] + k)
  
              # is current node a word
              if nodes[0].isWord:
                  words.append(prefixes[0])
  
              # remove current node
              del nodes[0]
              del prefixes[0]
  
      return words
  
file_path: calamari/calamari_ocr/thirdparty/ctcwordbeamsearch/PrefixTree.py
imports: from __future__ import division
  from __future__ import print_function
label_desc: Use image node_id 7 for calling the PrefixTree obj's underlying member method code with example usage: obj.getNextWords(text) and returns: words