input: Write a function to generate a Python class that reads in a text file and counts the frequency of each word. The class should include a method to retrieve the word counts.
  
  
  class WordCounter:
      def __init__(self, filename):
          self.word_counts = {}
          self.filename = filename
          self.process_file()
  
      def process_file(self):
          with open(self.filename) as f:
              for line in f:
                  words = line.split()
                  for word in words:
                      if word in self.word_counts:
                          self.word_counts[word] += 1
                      else:
                          self.word_counts[word] = 1
  
      def get_word_counts(self):
          return self.word_counts
  
  
  
  # Test cases
  assert WordCounter("example.txt").get_word_counts() == {'example': 2, 'text': 1}
  assert WordCounter("empty.txt").get_word_counts() == {}
  assert WordCounter("multiple_words.txt").get_word_counts() == {'hello': 3, 'world': 3}
  assert WordCounter("single_word.txt").get_word_counts() == {'test': 1}
  assert WordCounter("nonexistent_file.txt").get_word_counts() == {}
  
  
  
  # Expected outputs:
  # Example text file: "example example text"
  # Empty text file: ""
  # Multiple words file: "hello world hello world hello world"
  # Single word file: "test"
  # Nonexistent file: FileNotFoundError (handled silently by open)
  
output: class WordCounter:
      def __init__(self, filename):
          self.word_counts = {}
          self.filename = filename
          self.process_file()
  
      def process_file(self):
          try:
              with open(self.filename) as f:
                  for line in f:
                      words = line.split()
                      for word in words:
                          if word in self.word_counts:
                              self.word_counts[word] += 1
                          else:
                              self.word_counts[word] = 1
          except FileNotFoundError:
              pass
  
      def get_word_counts(self):
          return self.word_counts