Reverse the input sentence by sentence

Input

  • inputz [str]

Output

  • reverse [str]

Enpoint

https://hub.xpub.nl/soupboat/si16/api/reverse/ ? inputz=<inputz>

Try it



REVERSE!

from textblob import TextBlob

def reverse (inputz: str) -> str:
    """Reverse the input sentence by sentence"""
    blob = TextBlob(inputz)
    return "\n".join(str(reversed(blob.sentences)))

    # return " ".join(reversed(inputz.split()))
reverse("hello world")
'<\nl\ni\ns\nt\n_\nr\ne\nv\ne\nr\ns\ne\ni\nt\ne\nr\na\nt\no\nr\n \no\nb\nj\ne\nc\nt\n \na\nt\n \n0\nx\na\nc\n4\na\nf\n3\n9\n0\n>'