kieran_gem 3.0.0 → 8.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.
- checksums.yaml +4 -4
- data/lib/kieran_gem.rb +25 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c536157d0837ddbecc121636fcde0e2c945cdbbda82882e8f2099766a1c2053
|
4
|
+
data.tar.gz: 7d1cb89bb3a7e72fa5f9b1c126b096312e7b8bd1625aae27ec5645e9b4ebe2f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483b73084bea8403e9dbb6893e4e3bbc569ed432126c0e3e7ef90cfe3aa16ec183d033030b980efd2adb8ae6f3af3677e84279a0220f8c8a49eb34ed86106dae
|
7
|
+
data.tar.gz: 54f5104d177734cb27300bdece5ac57efaf2f1c22ed5cf2bf8dd160e637cdbd29a264a431af968950aa427252ab6c9fc803a06fa7d00205341727d535361c9f4
|
data/lib/kieran_gem.rb
CHANGED
@@ -37,9 +37,32 @@ 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
41
|
end
|
43
|
-
|
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
|
44
66
|
end
|
67
|
+
p @hCount
|
45
68
|
end
|