Synax error in string assignment
Sharan Basappa
sharan.basappa at gmail.com
Sun Aug 19 00:47:37 EDT 2018
I am not sure what the issue is with the 2nd file that assigns string to text variable.
Here is the code:
# -*- coding: utf-8 -*-
text = “this’s a sent tokenize test. this is sent two. is this sent three? sent 4 is cool! Now it’s your turn.”
from nltk.tokenize import sent_tokenize
sent_tokenize_list = sent_tokenize(text)
len(sent_tokenize_list)
sent_tokenize_list
Here is the error:
text = “this’s a sent tokenize test. this is sent two. is this sent three? sent 4 is cool! Now it’s your turn.”
^
SyntaxError: invalid syntax
BTW, the ^ operator pointing to the error is at text = and not for cool word. This is due to formatting issue in google group.
More information about the Python-list
mailing list