diff options
| -rwxr-xr-x | gpt_adventure.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gpt_adventure.py b/gpt_adventure.py index c2137db..6fda9fe 100755 --- a/gpt_adventure.py +++ b/gpt_adventure.py @@ -3,7 +3,6 @@ """GPT adventure is a text-adventure style game powered by AI.""" import argparse -import re import shutil import sys @@ -13,6 +12,7 @@ import transformers def load_nltk(): + """Download required nltk modules.""" try: tokenize.sent_tokenize("") except LookupError: @@ -20,6 +20,7 @@ def load_nltk(): def complete_sentence(snippet: str) -> bool: + """Return whether the snippet ends in a complete sentence.""" sentences = tokenize.sent_tokenize(snippet) return len(tokenize.sent_tokenize(sentences[-1] + " extra")) == 2 |
