Class: ChupaText::Decomposer
- Inherits:
-
Object
- Object
- ChupaText::Decomposer
show all
- Defined in:
- lib/chupa-text/decomposer.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options) ⇒ Decomposer
Returns a new instance of Decomposer.
25
26
27
|
# File 'lib/chupa-text/decomposer.rb', line 25
def initialize(options)
@options = options
end
|
Class Method Details
.registry ⇒ Object
20
21
22
|
# File 'lib/chupa-text/decomposer.rb', line 20
def registry
@@registry ||= DecomposerRegistry.new
end
|
Instance Method Details
#decompose(data) ⇒ Object
41
42
43
|
# File 'lib/chupa-text/decomposer.rb', line 41
def decompose(data)
raise NotImplementedError, "must implement #{self.class}\##{__method__}"
end
|
#target?(data) ⇒ Boolean
29
30
31
|
# File 'lib/chupa-text/decomposer.rb', line 29
def target?(data)
raise NotImplementedError, "must implement #{self.class}\##{__method__}"
end
|
#target_score(data) ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/chupa-text/decomposer.rb', line 33
def target_score(data)
if target?(data)
0
else
nil
end
end
|