Class: Glove::TokenPair
- Inherits:
-
Object
- Object
- Glove::TokenPair
- Defined in:
- lib/glove/token_pair.rb
Overview
Holds a token string and its neighbors in an array
Instance Attribute Summary collapse
-
#neighbors ⇒ Array<(String)>
] List of neighboring words.
-
#token ⇒ String
The word/token.
Instance Method Summary collapse
-
#initialize(token = '', neighbors = []) ⇒ TokenPair
constructor
Get class instance and set token and neighbors variables.
Constructor Details
#initialize(token = '', neighbors = []) ⇒ TokenPair
Get class instance and set token and neighbors variables
11 12 13 |
# File 'lib/glove/token_pair.rb', line 11 def initialize(token='', neighbors=[]) @token, @neighbors = token, neighbors end |
Instance Attribute Details
#neighbors ⇒ Array<(String)>
Returns ] List of neighboring words.
8 |
# File 'lib/glove/token_pair.rb', line 8 attr_accessor :token, :neighbors |
#token ⇒ String
Returns The word/token.
8 9 10 |
# File 'lib/glove/token_pair.rb', line 8 def token @token end |