Class: Term

Inherits:
Object
  • Object
show all
Defined in:
lib/term-extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tokens) {|_self| ... } ⇒ Term

Returns a new instance of Term.

Yields:

  • (_self)

Yield Parameters:

  • _self (Term)

    the object that the method was called on



6
7
8
9
# File 'lib/term-extractor.rb', line 6

def initialize(tokens)
  @tokens = tokens
  yield self if block_given?
end

Instance Attribute Details

#chunksObject

Returns the value of attribute chunks.



4
5
6
# File 'lib/term-extractor.rb', line 4

def chunks
  @chunks
end

#posObject

Returns the value of attribute pos.



4
5
6
# File 'lib/term-extractor.rb', line 4

def pos
  @pos
end

#sentenceObject

Returns the value of attribute sentence.



4
5
6
# File 'lib/term-extractor.rb', line 4

def sentence
  @sentence
end

#tokensObject

Returns the value of attribute tokens.



4
5
6
# File 'lib/term-extractor.rb', line 4

def tokens
  @tokens
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/term-extractor.rb', line 11

def to_s
  @to_s ||= TermExtractor.recombobulate_term(@tokens)
end