Приведенный ниже код принадлежит регулярному выражению NLTK:
import nltk
nltk.download('punkt')
from nltk.tokenize import word_tokenize
from nltk.tokenize import sent_tokenize
scene = "Hello how! how are you? what is your problem. Can I solve with 00code for you/ by the way bye. Take care"
match_index = print(re.search("you",scene))
print(match_index.start(),match_index.end())
Ошибка, которую я получил:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-54-5e13e5437c3e> in <module>()
----> 1 print(match_index.start(),match_index.end())
AttributeError: 'NoneType' object has no attribute 'start'
Я включил его библиотеку, но все равно он показывает ошибку.Как я могу справиться с этой ошибкой?