input: Write a function to implement an autocomplete system that predicts words based on the input text. The function should generate word candidates, filter them, rank them, and return the top 5 predicted words. If the input text is empty, return an empty list.
  assert autocomplete("hel")==["help", "hello", "helpful", "hell", "helm"]
  assert autocomplete("pro")==["program", "project", "process", "professional", "programming"]
  assert autocomplete("cat")==["category", "catalyst", "catch", "cat", "cater"]
  assert autocomplete("j")==["just", "job", "join", "jump", "jar"]
  assert autocomplete("")==[]
output: def autocomplete(text):
      if not text:
          return []
      words = ["help", "hello", "helpful", "hell", "helm", "program", "project", "process", "professional", "programming", "category", "catalyst", "catch", "cat", "cater", "just", "job", "join", "jump", "jar"]
      filtered_words = [word for word in words if word.startswith(text)]
      filtered_words.sort()
      return filtered_words[:5]