code: def test_rouge_n():
      candidate_text = "pulses may ease schizophrenic voices"
      candidate = PlaintextParser(
          candidate_text, Tokenizer("english")
      ).document.sentences
  
      reference1_text = "magnetic pulse series sent through brain may ease schizophrenic voices"
      reference1 = PlaintextParser(
          reference1_text, Tokenizer("english")
      ).document.sentences
  
      reference2_text = "yale finds magnetic stimulation some relief to schizophrenics imaginary voices"
  
      reference2 = PlaintextParser.from_string(
          reference2_text, Tokenizer("english")
      ).document.sentences
  
      assert rouge_n(candidate, reference1, 1) == approx(4 / 10)
      assert rouge_n(candidate, reference2, 1) == approx(1 / 10)
  
      assert rouge_n(candidate, reference1, 2) == approx(3 / 9)
      assert rouge_n(candidate, reference2, 2) == approx(0 / 9)
  
      assert rouge_n(candidate, reference1, 3) == approx(2 / 8)
      assert rouge_n(candidate, reference2, 3) == approx(0 / 8)
  
      assert rouge_n(candidate, reference1, 4) == approx(1 / 7)
      assert rouge_n(candidate, reference2, 4) == approx(0 / 7)
  
file_path: sumy/tests/test_evaluation/test_evaluation_rouge.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  from pytest import approx
  from sumy.evaluation import rouge_n, rouge_l_sentence_level, rouge_l_summary_level
  from sumy.evaluation.rouge import _get_ngrams, _split_into_words, _get_word_ngrams, _len_lcs, _recon_lcs, _union_lcs
  from sumy.nlp.tokenizers import Tokenizer
  from sumy.parsers.plaintext import PlaintextParser
label_desc: Use image node_id 7 for calling a global function with example usage: test_rouge_n() without return types