Class: NLP::Sentence
- Inherits:
-
Object
- Object
- NLP::Sentence
- Defined in:
- lib/sentence.rb
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
- #<<(tokens) ⇒ Object
-
#initialize ⇒ Sentence
constructor
A new instance of Sentence.
- #words_number ⇒ Object
Constructor Details
#initialize ⇒ Sentence
Returns a new instance of Sentence.
4 5 6 |
# File 'lib/sentence.rb', line 4 def initialize() @tokens = [] end |
Instance Attribute Details
#tokens ⇒ Object (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_number ⇒ Object
12 13 14 |
# File 'lib/sentence.rb', line 12 def words_number @tokens.size end |