kieran_gem 5.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kieran_gem.rb +24 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fedb45588e5a5b2bc595dbb53f57838e9336f036753d10dee78beb4b87a480c9
4
- data.tar.gz: f78ef3a10fe213e6589e0c79edfea88c596bdb13b30e89484ced150eb4f9c94d
3
+ metadata.gz: 401cd343d444b19d8e1d18a784f7ae80e18000ddcc16c21e372cd974c7f1ee3e
4
+ data.tar.gz: 59b3cd8a9568144df86e3c813ae4e9666f28cde7abe475e0b3b6bb08555e9ddd
5
5
  SHA512:
6
- metadata.gz: e0e961615be9a4dc7d8d486b61e4f012e60b75e4bf439fe4cd74c99b3043f94488a87a1d720ac89aed2cc408ea3668048f4d6ebd0f7080bc65e736adbe081fa6
7
- data.tar.gz: 93bcc7bc67846df91711e8208f0064640ed9427281e246795b509a7f26157422862da1a44c0e2e41c4bb17caae1c4ec18c5fe42504d88d641a297d97ea25d062
6
+ metadata.gz: f283ccd1d1e27237b022b6a783197e61d97c69254e394076d3ed1eccb6f106d2b6dd55ea34981ccd699e6e6e9ca40e5ab021d1a74232f30f477c6599a40d0f69
7
+ data.tar.gz: 837a61a23c024846a412c863cb8079f5bf83ca4f82b81e255b754f2269f9ba636fde89dbdab6f55d65f6474d754f2f1302783129dc41619a24c9bc034c360155
data/lib/kieran_gem.rb CHANGED
@@ -37,10 +37,31 @@ class Kieran_gem
37
37
  dog = ugh.split(" ")
38
38
  dog.each do |mouse|
39
39
  @cleanWords.push(mouse)
40
- #p @cleanWords
41
40
  end
42
- p @cleanWords
43
41
  end
44
- #p @cleanWords
42
+ # there has to be a smarter was to do this!!!!! this is completely stupid and a bad comsumption of resources
43
+ # annnnyway now we have one array with each post split by white space so we can actually start
44
+ # doing some mad $h!t
45
+ # p @cleanWords # is the final array of all the posts, we can use this to create a words count hash
46
+ # once this has is created we can start to generate graphics for an admin
47
+ # user to understand the over all sentiment of the websites content
48
+ # And thats the basic iteration of the data analysis concept of this application.
49
+
50
+ @hCount = Hash.new
51
+ @cleanWords.each {|w|
52
+ if @hCount.has_key?(w)
53
+ @hCount[w] = @hCount[w]+1
54
+ else
55
+ @hCount[w]=1
56
+ end
57
+ }
58
+ #sort the hash and print the results
59
+ @hCount.sort{|a,b| a[1]<=>b[1]}.each { |elem|
60
+ "\"#{elem[0]}\" has #{elem[1]} occurrences"
61
+ }
62
+ # end of sort
63
+ @hCount.delete('""')
64
+
65
+ puts @hCount
45
66
  end
46
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kieran_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kieran_Gem