input: Write a python function to calculate the frequency of each word in a given string.
  assert word_frequency('This is a test. This test is only a test.') == {'This': 2, 'is': 2, 'a': 2, 'test.': 2, 'test': 1, 'only': 1}
  assert word_frequency('hello world hello') == {'hello': 2, 'world': 1}
  assert word_frequency('one fish two fish red fish blue fish') == {'one': 1, 'fish': 4, 'two': 1, 'red': 1, 'blue': 1}
output: def word_frequency(s):
      words = s.split()
      freq = {}
      for word in words:
          if word in freq:
              freq[word] += 1
          else:
              freq[word] = 1
      return freq