Class: Html2rss::AutoSource::LinkHeuristics::AnchorSignals
- Inherits:
-
Data
- Object
- Data
- Html2rss::AutoSource::LinkHeuristics::AnchorSignals
- 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
-
#content_like_destination ⇒ Object
readonly
Returns the value of attribute content_like_destination.
-
#heading_anchor ⇒ Object
readonly
Returns the value of attribute heading_anchor.
-
#heading_text_match ⇒ Object
readonly
Returns the value of attribute heading_text_match.
-
#meaningful_text ⇒ Object
readonly
Returns the value of attribute meaningful_text.
Instance Method Summary collapse
-
#score ⇒ Integer
Ranking score for one eligible anchor.
Instance Attribute Details
#content_like_destination ⇒ Object (readonly)
Returns the value of attribute 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_anchor ⇒ Object (readonly)
Returns the value of attribute 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_match ⇒ Object (readonly)
Returns the value of attribute 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_text ⇒ Object (readonly)
Returns the value of attribute 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
#score ⇒ Integer
Returns 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 |