Class: Coelacanth::Extractor::FallbackProbe
- Inherits:
-
Object
- Object
- Coelacanth::Extractor::FallbackProbe
- Defined in:
- lib/coelacanth/extractor/fallback_probe.rb
Overview
Attempts final recovery strategies when all other probes fail.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
Instance Method Details
#call(doc:, url: nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/coelacanth/extractor/fallback_probe.rb', line 21 def call(doc:, url: nil) body = doc.at_css("body") || doc Result.new( title: doc.at_css("title")&.text&.strip, node: body, published_at: nil, byline: nil, source_tag: :fallback, confidence: 0.35 ) end |