Method: CorpusProcessor::Token#initialize

Defined in:
lib/corpus-processor/token.rb

#initialize(word = '', category = nil) ⇒ Token

Returns a new instance of Token.

Parameters:

  • word (String) (defaults to: '')

    the word from text. It shouldn't contain spaces.

  • category (Symbol) (defaults to: nil)

    the type of the CorpusProcessor::Token. It should be a valid category from Categories.



20
21
22
23
# File 'lib/corpus-processor/token.rb', line 20

def initialize word = '', category = nil
  self.word     = word
  self.category = category
end