You have a text that you want to tokenize. Match each line of the code with its result.
text = "I have got a cat. He's 3 years old."You have a text that you want to tokenize. Match each line of the code with its result.
text = "I have got a cat. He's 3 years old."print(word_tokenize(text))print(sent_tokenize(text))print(regexp_tokenize((text), "[A-z]+"))['I', 'have', 'got', 'a', 'cat', '.', 'He', "'s", '3', 'years', 'old', '.']['I', 'have', 'got', 'a', 'cat', 'He', 's', 'years', 'old']['I have got a cat.', "He's 3 years old."]Create a free account to access the full topic