Method: TermExtract#initialize
- Defined in:
- lib/term-extract.rb
#initialize(options = {}) ⇒ TermExtract
Returns a new instance of TermExtract.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/term-extract.rb', line 21 def initialize( = {}) # The minimum number of times a single word term must occur to be included in the results @min_occurance = .key?(:min_occurance) ? .delete(:min_occurance) : 3 # Always include multiword terms that comprise more than @min_terms words @min_terms = .key?(:min_terms) ? .delete(:min_terms) : 2 # Extract proper nouns (:nnp) or nouns (:nn) or both (:all) @types = .key?(:types) ? .delete(:types) : :all # Include the extracted POS tags in the results = .key?(:include_tags) ? .delete(:include_tags) : false # Remove shorter terms that are part of larger ones @collapse_terms = .key?(:collapse_terms) ? .delete(:collapse_terms) : true #@lazy = options.key?(:lazy) ? options.delete(:lazy) : false end |