input: Write a python function to compute the frequency of every word in a text document using a class.
  assert TextAnalyzer("hello world hello").count_words() == {'hello': 2, 'world': 1}
  assert TextAnalyzer("test test test").count_words() == {'test': 3}
  assert TextAnalyzer("Python is great and Python is fun").count_words() == {'Python': 2, 'is': 2, 'great': 1, 'and': 1, 'fun': 1}
output: class TextAnalyzer:
      def __init__(self, text):
          self.text = text
  
      def count_words(self):
          word_counts = {}
          words = self.text.split()
          for word in words:
              if word in word_counts:
                  word_counts[word] += 1
              else:
                  word_counts[word] = 1
          return word_counts