1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.plugin.autotag

File TagCloud.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
83% of files have more coverage

Code metrics

0
16
13
1
174
69
13
0.81
1.23
13
1

Classes

Class Line # Actions
TagCloud 33 16 0% 13 29
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki.plugin.autotag;
21   
22    import java.util.Map;
23    import java.util.Set;
24   
25    /**
26    * Data structure used by the {@link AutoTagPlugin}, holding information about a collection of tags appearing the most
27    * in a collection of documents.
28    *
29    * @version $Id: a64ae68b60dd714c85fb02aeab943306121b774f $
30    * @deprecated the entire Autotag plugin is deprecated, along with its data structures
31    */
32    @Deprecated
 
33    public class TagCloud
34    {
35    /** The text from which to extract tags. */
36    private String text;
37   
38    /** The represented text, split into a sequence of words (tokens). */
39    private String[] wordList;
40   
41    /** Words and their frequency, i.e. how many times they appear in the text. */
42    private Map<String, Integer> countedWordMap;
43   
44    /** Word frequencies grouped based on their common stem. */
45    private Map<String, Map<String, Integer>> stemmedWordMap;
46   
47    /** Lead words and their frequencies, i.e. how many times they appear in the text. */
48    private Map<String, Integer> stemmedWordFreqMap;
49   
50    /** The extracted tags. */
51    private Set<Tag> tags;
52   
53    /**
54    * Get the HTML markup to represent this tag cloud.
55    *
56    * @return HTML markup
57    */
 
58  0 toggle public String getHtml()
59    {
60  0 StringBuilder result = new StringBuilder();
61  0 for (Tag t : this.tags) {
62  0 result.append(t.getHtml());
63    }
64  0 return result.toString();
65    }
66   
67    /**
68    * @return the analyzed text
69    * @see #text
70    */
 
71  0 toggle public String getText()
72    {
73  0 return this.text;
74    }
75   
76    /**
77    * @param text the text to analyze
78    * @see #text
79    */
 
80  0 toggle public void setText(String text)
81    {
82  0 this.text = text;
83    }
84   
85    /**
86    * @return the tokenized text
87    * @see #wordList
88    */
 
89  0 toggle public String[] getWordList()
90    {
91  0 return this.wordList;
92    }
93   
94    /**
95    * @param wordList the tokenized text
96    * @see #wordList
97    */
 
98  0 toggle public void setWordList(String[] wordList)
99    {
100  0 this.wordList = wordList;
101    }
102   
103    /**
104    * @return map of {@code token->number of appearances} count for each token present in the text
105    * @see #countedWordMap
106    */
 
107  0 toggle public Map<String, Integer> getCountedWordMap()
108    {
109  0 return this.countedWordMap;
110    }
111   
112    /**
113    * @param countedWordMap map of {@code token->number of appearances} count for each token present in the text
114    * @see #countedWordMap
115    */
 
116  0 toggle public void setCountedWordMap(Map<String, Integer> countedWordMap)
117    {
118  0 this.countedWordMap = countedWordMap;
119    }
120   
121    /**
122    * @return token groups
123    * @see #stemmedWordMap
124    */
 
125  0 toggle public Map<String, Map<String, Integer>> getStemmedWordMap()
126    {
127  0 return this.stemmedWordMap;
128    }
129   
130    /**
131    * @param stemmedWordMap token groups
132    * @see #stemmedWordMap
133    */
 
134  0 toggle public void setStemmedWordMap(Map<String, Map<String, Integer>> stemmedWordMap)
135    {
136  0 this.stemmedWordMap = stemmedWordMap;
137    }
138   
139    /**
140    * @return map of lead words and their frequencies
141    * @see #stemmedWordFreqMap
142    */
 
143  0 toggle public Map<String, Integer> getStemmedWordFreqMap()
144    {
145  0 return this.stemmedWordFreqMap;
146    }
147   
148    /**
149    * @param stemmedWordFreqMap map of lead words and their frequencies
150    * @see #stemmedWordFreqMap
151    */
 
152  0 toggle public void setStemmedWordFreqMap(Map<String, Integer> stemmedWordFreqMap)
153    {
154  0 this.stemmedWordFreqMap = stemmedWordFreqMap;
155    }
156   
157    /**
158    * @return the set of extracted tags
159    * @see #tags
160    */
 
161  0 toggle public Set<Tag> getTags()
162    {
163  0 return this.tags;
164    }
165   
166    /**
167    * @param tags the set of extracted tags
168    * @see #tags
169    */
 
170  0 toggle public void setTags(Set<Tag> tags)
171    {
172  0 this.tags = tags;
173    }
174    }