docstr: segment single sentence (whitespace-tokenized string) with BPE encoding
docstr_tok: ["segment","single","sentence","(","whitespace-tokenized","string",")","with","BPE","encoding"]
code: def segment(self, sentence):
      """segment single sentence (whitespace-tokenized string) with BPE encoding"""
      output = []
      for word in sentence.split():
          new_word = [
              out
              for segment in self._isolate_glossaries(word)
              for out in encode(
                  segment,
                  self.bpe_codes,
                  self.bpe_codes_reverse,
                  self.vocab,
                  self.separator,
                  self.version,
                  self.cache,
                  self.glossaries,
              )
          ]
  
          for item in new_word[:-1]:
              output.append(item + self.separator)
          output.append(new_word[-1])
  
      return " ".join(output)
  
imports: from __future__ import unicode_literals, division
  import sys
  import codecs
  import io
  import argparse
  import json
  import re
  from collections import defaultdict
  from io import open
label_desc: Use image node_id 2 for calling the BPE obj's underlying member method code with example usage: obj.segment(sentence) and returns: str