Class: Html2rss::HtmlExtractor::SemanticAnchorCandidates::AnchorFacts
- Inherits:
-
Data
- Object
- Data
- Html2rss::HtmlExtractor::SemanticAnchorCandidates::AnchorFacts
- Defined in:
- lib/html2rss/html_extractor/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
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def anchor @anchor end |
#content_like_destination ⇒ Object (readonly)
Returns the value of attribute content_like_destination
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def content_like_destination @content_like_destination end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def destination @destination end |
#heading_anchor ⇒ Object (readonly)
Returns the value of attribute heading_anchor
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def heading_anchor @heading_anchor end |
#heading_text_match ⇒ Object (readonly)
Returns the value of attribute heading_text_match
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def heading_text_match @heading_text_match end |
#meaningful_text ⇒ Object (readonly)
Returns the value of attribute meaningful_text
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def meaningful_text @meaningful_text end |
#score ⇒ Object (readonly)
Returns the value of attribute score
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def score @score end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def segments @segments end |
#text ⇒ Object (readonly)
Returns the value of attribute text
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def text @text end |
#url ⇒ Object (readonly)
Returns the value of attribute url
9 10 11 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 9 def url @url end |
Class Method Details
.from_candidate(candidate) ⇒ AnchorFacts
Returns serializable facts used for ranking and dedupe.
23 24 25 26 27 28 29 |
# File 'lib/html2rss/html_extractor/semantic_anchor_candidates.rb', line 23 def self.from_candidate(candidate) new( **candidate.anchor_identity_attributes, **candidate.anchor_signal_attributes, score: Score.new(candidate).value ) end |