You have a sentence in the input. Tokenize it with TreebankWordTokenizer.
Tokenization implementation
TreebankWordTokenizer
Report a typo
Sample Input 1:
Alpha Centauri is listed in the 2nd-century star catalog of PtolemySample Output 1:
['Alpha', 'Centauri', 'is', 'listed', 'in', 'the', '2nd-century', 'star', 'catalog', 'of', 'Ptolemy']Write a program in Python 3
# put your python code here
from nltk import TreebankWordTokenizer as TWT
text = input()
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.