input: Write a function to create an autocomplete system that predicts words based on the input text. The function should generate word candidates, filter them, and return the top 5 ranked words.
  def autocomplete(input_text):
      # Generate the word candidates
      word_candidates = generate_candidates(input_text)
      # Filter the word candidates 
      filtered_words = filter_candidates(word_candidates)
      # Rank the words and return the top 5 
      sorted_words = rank_words(filtered_words)
      return sorted_words[:5]
  
  assert autocomplete('hello')==['hello', 'hell', 'help', 'helmet', 'hello world']
  assert autocomplete('')==['the', 'a', 'in', 'on', 'for']
  assert autocomplete('python')==['python', 'pythons', 'python3', 'pythonic', 'pythonista']
  assert autocomplete('cat')==['cat', 'catch', 'category', 'caterpillar', 'catnip']
  assert autocomplete('dog')==['dog', 'dogs', 'doggy', 'dogma', 'dogged']
output: def autocomplete(input_text):
      word_candidates = generate_candidates(input_text)
      filtered_words = filter_candidates(word_candidates)
      sorted_words = rank_words(filtered_words)
      return sorted_words[:5]