input: Write a function to create an autocomplete system that predicts words based on the input text. The function should generate word candidates from the input text, filter these candidates, rank them, and return the top 5 words. If the input text is empty, the function should return an empty list.
  assert autocomplete("pro")==["program", "procedure", "process", "produce", "product"]
  assert autocomplete("ex")==["example", "execute", "explore", "export", "examine"]
  assert autocomplete("")==[]
  assert autocomplete("a")==["algorithm", "analysis", "approach", "application", "archive"]
output: def autocomplete(text):
      words = ["program", "procedure", "process", "produce", "product", "example", "execute", "explore", "export", "examine", "algorithm", "analysis", "approach", "application", "archive"]
      if not text:
          return []
      candidates = [word for word in words if word.startswith(text)]
      candidates.sort()
      return candidates[:5]