Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Building a tag cloud is, as I see it, a two part process:</p> <p>First, you need to split and count your tokens. Depending on how the document is structured, as well as the language it is written in, this could be as easy as counting the space-separated words. However, this is a very naive approach, as words like the, of, a, etc... will have the biggest word-count and are not very useful as tags. I would suggest implementing some sort of word black list, in order to exclude the most common and meaningless tags. </p> <p>Once you have the result in a (tag, count) way, you could use something similar to the following code:</p> <p>(Searches is a list of SearchRecordEntity, SearchRecordEntity holds the tag and its count, SearchTagElement is a subclass of SearchRecordEntity that has the TagCategory attribute,and ProcessedTags is a List of SearchTagElements which holds the result)</p> <pre><code>double max = Searches.Max(x =&gt; (double)x.Count); List&lt;SearchTagElement&gt; processedTags = new List&lt;SearchTagElement&gt;(); foreach (SearchRecordEntity sd in Searches) { var element = new SearchTagElement(); double count = (double)sd.Count; double percent = (count / max) * 100; if (percent &lt; 20) { element.TagCategory = "smallestTag"; } else if (percent &lt; 40) { element.TagCategory = "smallTag"; } else if (percent &lt; 60) { element.TagCategory = "mediumTag"; } else if (percent &lt; 80) { element.TagCategory = "largeTag"; } else { element.TagCategory = "largestTag"; } processedTags.Add(element); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload