Class: Html2rss::AutoSource::LinkHeuristics::AnchorSignals

Inherits:
Data
  • Object
show all
Defined in:
lib/html2rss/auto_source/link_heuristics/anchor_signals.rb

Overview

Anchor ranking signals used by semantic primary-link selection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_like_destinationObject (readonly)

Returns the value of attribute content_like_destination

Returns:

  • (Object)

    the current value of content_like_destination



15
16
17
# File 'lib/html2rss/auto_source/link_heuristics/anchor_signals.rb', line 15

def content_like_destination
  @content_like_destination
end

#heading_anchorObject (readonly)

Returns the value of attribute heading_anchor

Returns:

  • (Object)

    the current value of heading_anchor



15
16
17
# File 'lib/html2rss/auto_source/link_heuristics/anchor_signals.rb', line 15

def heading_anchor
  @heading_anchor
end

#heading_text_matchObject (readonly)

Returns the value of attribute heading_text_match

Returns:

  • (Object)

    the current value of heading_text_match



15
16
17
# File 'lib/html2rss/auto_source/link_heuristics/anchor_signals.rb', line 15

def heading_text_match
  @heading_text_match
end

#meaningful_textObject (readonly)

Returns the value of attribute meaningful_text

Returns:

  • (Object)

    the current value of meaningful_text



15
16
17
# File 'lib/html2rss/auto_source/link_heuristics/anchor_signals.rb', line 15

def meaningful_text
  @meaningful_text
end

Instance Method Details

#scoreInteger

Returns ranking score for one eligible anchor.

Returns:

  • (Integer)

    ranking score for one eligible anchor



22
23
24
# File 'lib/html2rss/auto_source/link_heuristics/anchor_signals.rb', line 22

def score
  ANCHOR_SCORE_RULES.sum { |signal, weight| public_send(signal) ? weight : 0 }
end