Last active
August 2, 2016 15:15
-
-
Save AnkurVyas-BTC/d34cfde27496aa6d12b4156904fc089c to your computer and use it in GitHub Desktop.
Wordcounted gem index page view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Content</h1> | |
<p> <%= @sentence%></p> | |
<h1>Content Stats</h1> | |
<p><b>Total Words</b> = <%= @counter_with_stop_words.token_count %></p> | |
<p><b>Total Price</b> = $<%= @price %></p> | |
<p><b>Total Unique Words</b> = <%= @counter_with_stop_words.uniq_token_count %></p> | |
<p><b>Most Frequent Token</b> = <%= @counter.most_frequent_tokens.keys.first %></p> | |
<p><b>Longest Token</b> = <%= @counter.longest_tokens.keys.first %></p> | |
<p><b>Character count</b> = <%= @counter_with_stop_words.char_count %></p> | |
<p><b>Token Density</b></p> | |
<% @counter.token_density.first(5).each do |arr| %> | |
<%= arr[0]%> - <%= number_with_precision(arr[1]*100,precision: 1)%>% | |
<br> | |
<% end %> | |
<p><b>Counter Frequency </b></p> | |
<% @counter.token_frequency.first(5).each do |arr| %> | |
<%= arr[0]%> - <%= arr[1]%> | |
<br> | |
<% end %> | |
<p><b>Token Lengths</b></p> | |
<% @counter.token_lengths.first(5).each do |arr| %> | |
<%= arr[0]%> - <%= arr[1]%> | |
<br> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment