Class: ListTagger

Inherits:
Tagger show all
Defined in:
lib/list_tagger.rb

Instance Method Summary collapse

Methods inherited from Tagger

#normalize

Instance Method Details

#parse_main(text) ⇒ Object



33
34
35
# File 'lib/list_tagger.rb', line 33

def parse_main(text)
    return parse_text(text, @default_precondition, @default_search, @content_group)
end

#parse_text(text, precondition, search, content_group = @content_group) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/list_tagger.rb', line 20

def parse_text(text, precondition, search, content_group = @content_group)
    tags = []
    content_group = 1
    @list.each do |form|
        if text =~ form
            precondition = form
            search = /(\b#{form})/i
            tags += super text, precondition, search, content_group
        end
    end
    return tags
end