code: def test_compute_ratings():
      summarizer = _build_summarizer(EMPTY_STOP_WORDS)
  
      s0 = Sentence("Dog cat fish.", Tokenizer("english"))
      s1 = Sentence("Dog cat camel.", Tokenizer("english"))
      s2 = Sentence("Fish frog horse.", Tokenizer("english"))
      document = build_document([s0, s1, s2])
  
      ratings = summarizer._compute_ratings(document.sentences)
      assert ratings[s0] == 0
      assert ratings[s1] == -2
      assert ratings[s2] == -1
  
      # Due to the frequency discounting, after finding sentence s0,
      # s2 should come before s1 since only two of its words get discounted
      # rather than all 3 of s1's
      s0 = Sentence("one two three", Tokenizer("english"))
      s1 = Sentence("one two four", Tokenizer("english"))
      s2 = Sentence("three five six", Tokenizer("english"))
      document = build_document([s0, s1, s2])
  
      ratings = summarizer._compute_ratings(document.sentences)
      assert ratings[s0] == 0
      assert ratings[s1] == -2
      assert ratings[s2] == -1
  
file_path: sumy/tests/test_summarizers/test_sum_basic.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import pytest
  from sumy.models.dom._sentence import Sentence
  from sumy.nlp.tokenizers import Tokenizer
  from sumy.summarizers.sum_basic import SumBasicSummarizer
  from sumy.nlp.stemmers import Stemmer
  from ..utils import build_document
label_desc: Use image node_id 12 for calling a global function with example usage: test_compute_ratings() without return types