input: Write a python function to correct the spelling of words using a dictionary file named 'words.txt'.
  assert spell_correction("helo worldd") == "hello world"
  assert spell_correction("speling corection") == "spelling correction"
  assert spell_correction("pythn funtion") == "python function"
output: def spell_correction(text):
      from difflib import get_close_matches
  
      # Load the dictionary of words
      with open('words.txt', 'r') as file:
          words = set(file.read().split())
  
      # Function to find the closest match for a given word
      def correct_word(word):
          matches = get_close_matches(word, words, n=1)
          return matches[0] if matches else word
  
      # Split the text into words and correct each word
      corrected_words = [correct_word(word) for word in text.split()]
      return 'to correct the spelling of words using a dictionary file named 'words.txt'.
  assert spell_correction("helo worldd") == "hello world"
  assert spell_correction("speling corection") == "spelling correction"
  assert spell_correction("pythn funtion") == "python function"