Class: NLP::Sentence

Inherits:
Object
  • Object
show all
Defined in:
lib/sentence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSentence

Returns a new instance of Sentence.



4
5
6
# File 'lib/sentence.rb', line 4

def initialize()
    @tokens = []
end

Instance Attribute Details

#tokensObject (readonly)

Returns the value of attribute tokens.



3
4
5
# File 'lib/sentence.rb', line 3

def tokens
  @tokens
end

Instance Method Details

#<<(tokens) ⇒ Object



8
9
10
# File 'lib/sentence.rb', line 8

def << tokens
    @tokens.concat tokens
end

#words_numberObject



12
13
14
# File 'lib/sentence.rb', line 12

def words_number
    @tokens.size
end