MCPcopy Create free account
hub / github.com/DavidBelicza/TextRank / TestWeightingHits

Function TestWeightingHits

rank/algorithm_test.go:26–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestWeightingHits(t *testing.T) {
27 rank := createRank()
28
29 def := NewAlgorithmDefault()
30 weightDef := def.WeightingHits(0, rank)
31
32 assert.Equal(t, float32(2), weightDef)
33
34 chain := NewAlgorithmChain()
35 weightChain := chain.WeightingHits(0, rank)
36
37 assert.Equal(t, float32(3), weightChain)
38
39 weightChain = chain.WeightingHits(2, rank)
40
41 assert.Equal(t, float32(3), weightChain)
42}
43
44func createRank() *Rank {
45 rank := NewRank()

Callers

nothing calls this directly

Calls 5

WeightingHitsMethod · 0.95
WeightingHitsMethod · 0.95
createRankFunction · 0.85
NewAlgorithmDefaultFunction · 0.85
NewAlgorithmChainFunction · 0.85

Tested by

no test coverage detected