python project

  1. Define a function called find_url to find a url in a string and return the url and its position.
  2. Define a function called vocab_size(text) that has a single parameter for the text, and which returns the vocabulary size of the text.
  3. Define a function percent(word, text) that calculates how often a given word occurs in a text, and expresses the result as a percentage.
  4. Write a Python program to read a text file and test the above functions and print their results.

Â

 Regular Expression

Â

the file of txt import form this book

chapter 2

http://www.nltk.org/book/

the file txt(shakespeare-macbeth.txt)

Order from us and get better grades. We are the service you have been looking for.