Class: Html2rss::AutoSource::Discovery::SemanticAnchorCandidates::AnchorFacts
- Inherits:
-
Data
- Object
- Data
- Html2rss::AutoSource::Discovery::SemanticAnchorCandidates::AnchorFacts
- Defined in:
- lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb
Overview
Anchor candidate plus scoring signals used by semantic anchor ranking.
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#content_like_destination ⇒ Object
readonly
Returns the value of attribute content_like_destination.
-
#destination ⇒ Object
readonly
Returns the value of attribute 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.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.from_candidate(candidate) ⇒ AnchorFacts
Serializable facts used for ranking and dedupe.
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def anchor @anchor end |
#content_like_destination ⇒ Object (readonly)
Returns the value of attribute content_like_destination
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def content_like_destination @content_like_destination end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def destination @destination end |
#heading_anchor ⇒ Object (readonly)
Returns the value of attribute heading_anchor
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def heading_anchor @heading_anchor end |
#heading_text_match ⇒ Object (readonly)
Returns the value of attribute heading_text_match
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def heading_text_match @heading_text_match end |
#meaningful_text ⇒ Object (readonly)
Returns the value of attribute meaningful_text
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def meaningful_text @meaningful_text end |
#score ⇒ Object (readonly)
Returns the value of attribute score
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def score @score end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def segments @segments end |
#text ⇒ Object (readonly)
Returns the value of attribute text
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def text @text end |
#url ⇒ Object (readonly)
Returns the value of attribute url
10 11 12 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 10 def url @url end |
Class Method Details
.from_candidate(candidate) ⇒ AnchorFacts
Returns serializable facts used for ranking and dedupe.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/html2rss/auto_source/discovery/semantic_anchor_candidates.rb', line 24 def self.from_candidate(candidate) signals = candidate.anchor_signals new( **candidate.anchor_identity_attributes, meaningful_text: signals.meaningful_text, content_like_destination: signals.content_like_destination, heading_anchor: signals.heading_anchor, heading_text_match: signals.heading_text_match, score: signals.score ) end |