input: Write a function to generate n-grams of the given text with a specified window size. The function should return a Counter object containing the frequency of each n-gram. If the given text is empty, the function should return an empty Counter object.
  assert generate_ngrams("The quick brown fox jumps over the lazy dog", 3) == Counter({'the quick brown': 3, 'quick brown fox': 2, 'over the lazy': 1, 'brown fox jumps': 1, 'fox jumps over': 1, 'the lazy dog': 1, 'jumps over the': 1, 'quick brown fox jumps': 1})
  assert generate_ngrams("The quick brown fox", 2) == Counter({'the quick': 4, 'quick brown': 4, 'brown fox': 3})
  assert generate_ngrams("", 3) == Counter()
  assert generate_ngrams("hi", 1) == Counter({'hi': 5})
output: def generate_ngrams(text, n):
      if not text:
          return Counter()
      words = text.split()
      ngrams = [' '.join(words[i:i+n]) for i in range(len(words)-n+1)]
      return Counter(ngrams)