com.xpn.xwiki.plugin.autotag
Class AutoTagPlugin

java.lang.Object
  extended by com.xpn.xwiki.plugin.XWikiDefaultPlugin
      extended by com.xpn.xwiki.plugin.autotag.AutoTagPlugin
All Implemented Interfaces:
XWikiPluginInterface

Deprecated. the plugin technology is deprecated, consider rewriting as components

@Deprecated
public class AutoTagPlugin
extends XWikiDefaultPlugin
implements XWikiPluginInterface

Plugin which extracts a set of tags from a text.

Version:
$Id: e30fac037d84bc9c172fff38493f900354bdcc6b $

Field Summary
static int LANG_ENGLISH
          Deprecated. Identifier for the English language.
static int LANG_FRENCH
          Deprecated. Identifier for the French language.
 
Constructor Summary
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
 TagCloud countWords(String text, int lang)
          Deprecated. Analyze a piece of text, splitting it into individual words, along with their frequencies.
 TagCloud generateTagCloud(String text, int lang)
          Deprecated. Analyze a piece of text, and extract the most common words into a "tag cloud".
 int getLanguageConstant(String lang)
          Deprecated. Get the identifier corresponding to the given two-leter country code.
 String getName()
          Deprecated.  
 AutoTagPluginAPI getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
          Deprecated.  
 void init(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, insidePREHandler, 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 name
className - the name of this class, ignored
context - the current request context
Method Detail

init

public void init(XWikiContext context)
Deprecated. 
Specified by:
init in interface XWikiPluginInterface
Overrides:
init in class XWikiDefaultPlugin

getName

public String getName()
Deprecated. 
Specified by:
getName in interface XWikiPluginInterface
Overrides:
getName in class XWikiDefaultPlugin

getPluginApi

public AutoTagPluginAPI getPluginApi(XWikiPluginInterface plugin,
                                     XWikiContext context)
Deprecated. 
Specified by:
getPluginApi in interface XWikiPluginInterface
Overrides:
getPluginApi in class XWikiDefaultPlugin

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 analyze
lang - the language in which the text is written, 0 for French or 1 for 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 analyze
lang - the language, 0 for French or 1 for 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 keys
V - 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:
0 for French ("fr") or 1 for English ("en") and all other passed values


Copyright © 2004-2013 XWiki. All Rights Reserved.