nltk.tokenwrap()

nltk.tokenwrap(tokens, separator=' ', width=70)[source]

Pretty print a list of text tokens, breaking lines on whitespace

Parameters:
  • tokens (list) – the tokens to print
  • separator (str) – the string to use to separate tokens
  • width (int) – the display width (default=70)