Package com.xpn.xwiki.plugin.autotag
Class AutoTagPlugin
- java.lang.Object
-
- com.xpn.xwiki.plugin.XWikiDefaultPlugin
-
- com.xpn.xwiki.plugin.autotag.AutoTagPlugin
-
- All Implemented Interfaces:
XWikiPluginInterface
@Deprecated public class AutoTagPlugin extends XWikiDefaultPlugin implements XWikiPluginInterface
Deprecated.the plugin technology is deprecated, consider rewriting as componentsPlugin which extracts a set of tags from a text.- Version:
- $Id: e30fac037d84bc9c172fff38493f900354bdcc6b $
-
-
Field Summary
Fields Modifier and Type Field Description static intLANG_ENGLISHDeprecated.Identifier for the English language.static intLANG_FRENCHDeprecated.Identifier for the French language.
-
Constructor Summary
Constructors Constructor Description AutoTagPlugin(String name, String className, XWikiContext context)Deprecated.The mandatory plugin constructor, this is the method called (through reflection) by the plugin manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TagCloudcountWords(String text, int lang)Deprecated.Analyze a piece of text, splitting it into individual words, along with their frequencies.TagCloudgenerateTagCloud(String text, int lang)Deprecated.Analyze a piece of text, and extract the most common words into a "tag cloud".intgetLanguageConstant(String lang)Deprecated.Get the identifier corresponding to the given two-leter country code.StringgetName()Deprecated.AutoTagPluginAPIgetPluginApi(XWikiPluginInterface plugin, XWikiContext context)Deprecated.voidinit(XWikiContext context)Deprecated.static <K,V>
Map<K,V>sortMap(Map<K,V> hmap)Deprecated.Return a copy of a map, sorted in ascending order of their values.static <T extends Comparable<T>>
SortedSet<T>sortSet(Set<T> oSet)Deprecated.Return a sorted copy of a set.-
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, flushCache, getClassName, getLocalization, insidePREHandler, localizePlainOrKey, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.xpn.xwiki.plugin.XWikiPluginInterface
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, insidePREHandler, outsidePREHandler, startRenderingHandler, virtualInit
-
-
-
-
Field Detail
-
LANG_FRENCH
public static final int LANG_FRENCH
Deprecated.Identifier for the French language.- See Also:
- Constant Field Values
-
LANG_ENGLISH
public static final int LANG_ENGLISH
Deprecated.Identifier for the English language.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AutoTagPlugin
public AutoTagPlugin(String name, String className, XWikiContext context)
Deprecated.The mandatory plugin constructor, this is the method called (through reflection) by the plugin manager.- Parameters:
name- the plugin name, usually ignored, since plugins have a fixed nameclassName- the name of this class, ignoredcontext- the current request context
-
-
Method Detail
-
init
public void init(XWikiContext context)
Deprecated.- Specified by:
initin interfaceXWikiPluginInterface- Overrides:
initin classXWikiDefaultPlugin
-
getName
public String getName()
Deprecated.- Specified by:
getNamein interfaceXWikiPluginInterface- Overrides:
getNamein classXWikiDefaultPlugin
-
getPluginApi
public AutoTagPluginAPI getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
Deprecated.- Specified by:
getPluginApiin interfaceXWikiPluginInterface- Overrides:
getPluginApiin classXWikiDefaultPlugin
-
generateTagCloud
public TagCloud generateTagCloud(String text, int lang)
Deprecated.Analyze a piece of text, and extract the most common words into a "tag cloud". In detail, this splits the text into tokens, counts how many times each token appears in the text, removes the "stop-words", joins together words from the same root (stemming), and prepares an HTML tag cloud which can be printed in the response.- Parameters:
text- the text to analyzelang- the language in which the text is written,0for French or1for English- Returns:
- the resulting TagCloud with all the analyzed data, including the HTML tag cloud
-
countWords
public TagCloud countWords(String text, int lang)
Deprecated.Analyze a piece of text, splitting it into individual words, along with their frequencies. In detail, this splits the text into tokens, counts how many times each token appears in the text, removes the "stop-words", and joins together words from the same root (stemming).generateTagCloud(String, int)also prepares an HTML tag cloud which can be printed in the response.- Parameters:
text- the text to analyzelang- the language,0for French or1for English- Returns:
- the resulting TagCloud with all the analyzed data, except the HTML tag cloud
-
sortSet
public static <T extends Comparable<T>> SortedSet<T> sortSet(Set<T> oSet)
Deprecated.Return a sorted copy of a set.- Type Parameters:
T- the type of the items in the set- Parameters:
oSet- the set containing the values to sort; it is not affected in any way by this method- Returns:
- a new sorted set containing all the values in the input set
-
sortMap
public static <K,V> Map<K,V> sortMap(Map<K,V> hmap)
Deprecated.Return a copy of a map, sorted in ascending order of their values.- Type Parameters:
K- the type of the map keysV- the type of the map values- Parameters:
hmap- the map containing the entries to sort; it is not affected in any way by this method- Returns:
- a new sorted map containing all the entries in the input map
-
getLanguageConstant
public int getLanguageConstant(String lang)
Deprecated.Get the identifier corresponding to the given two-leter country code. Currently the only supported values are "en" and "fr".- Parameters:
lang- the two-letter ISO 3166-1 alpha-2 code of a country- Returns:
0for French ("fr") or1for English ("en") and all other passed values
-
-