Class: Zipfy::WordData
- Inherits:
-
Object
- Object
- Zipfy::WordData
- Defined in:
- lib/zipfy/word_data.rb
Instance Attribute Summary collapse
-
#frequency ⇒ Object
Returns the value of attribute frequency.
-
#word ⇒ Object
Returns the value of attribute word.
-
#zip_number ⇒ Object
theoretically equal to 1/rank in a text.
Instance Method Summary collapse
-
#initialize(word, frequency = 1) ⇒ WordData
constructor
A new instance of WordData.
Constructor Details
#initialize(word, frequency = 1) ⇒ WordData
Returns a new instance of WordData.
8 9 10 11 |
# File 'lib/zipfy/word_data.rb', line 8 def initialize word, frequency = 1 @word = word @frequency = frequency end |
Instance Attribute Details
#frequency ⇒ Object
Returns the value of attribute frequency.
5 6 7 |
# File 'lib/zipfy/word_data.rb', line 5 def frequency @frequency end |
#word ⇒ Object
Returns the value of attribute word.
4 5 6 |
# File 'lib/zipfy/word_data.rb', line 4 def word @word end |
#zip_number ⇒ Object
theoretically equal to 1/rank in a text
6 7 8 |
# File 'lib/zipfy/word_data.rb', line 6 def zip_number @zip_number end |