net.sf.mmapps.commons.util
Class KeywordUtil

java.lang.Object
  extended by net.sf.mmapps.commons.util.KeywordUtil

public class KeywordUtil
extends java.lang.Object


Constructor Summary
KeywordUtil()
           
 
Method Summary
static java.lang.String detectLanguage(java.lang.String text)
           
static java.lang.String[] getCommonWords(java.lang.String text)
           
static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings)
          Get keywords from the strings.
static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings, int max)
          Get keywords from the strings.
static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings, java.lang.String language)
          Get keywords from the strings
static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings, java.lang.String[] ignoreWords, int max)
          Get keywords from the strings
static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings, java.lang.String language, int max)
          Get keywords from the strings
static java.util.List<java.lang.String> getKeywords(java.lang.String text)
          Get keywords from a text.
static java.util.List<java.lang.String> getKeywords(java.lang.String text, int max)
          Get keywords from a text.
static java.util.List<java.lang.String> getKeywords(java.lang.String text, java.lang.String language)
          Get keywords from a text
static java.util.List<java.lang.String> getKeywords(java.lang.String text, java.lang.String[] ignoreWords, int max)
          Get keywords from a text
static java.util.List<java.lang.String> getKeywords(java.lang.String text, java.lang.String language, int max)
          Get keywords from a text
static java.lang.String keywordsToString(java.util.List<java.lang.String> keywords)
          Convert list of keywords to comma-separated string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeywordUtil

public KeywordUtil()
Method Detail

keywordsToString

public static java.lang.String keywordsToString(java.util.List<java.lang.String> keywords)
Convert list of keywords to comma-separated string

Parameters:
keywords - - list of keywords
Returns:
string of keywords

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.lang.String text)
Get keywords from a text. This methods tries to detect which language it is in. When the language is not detected then all words are eligable to be a keyword.

Parameters:
text - - full text from which the keywords should be extracted
Returns:
keywords found in text

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.lang.String text,
                                                           java.lang.String language)
Get keywords from a text

Parameters:
text - - full text from which the keywords should be extracted
language - - When the language is not recognized then all words are eligable to be a keyword.
Returns:
keywords found in text

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.lang.String text,
                                                           java.lang.String language,
                                                           int max)
Get keywords from a text

Parameters:
text - - full text from which the keywords should be extracted
language - - When the language is not recognized then all words are eligable to be a keyword.
max - - maximum number of keywords returned
Returns:
keywords found in text

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.lang.String text,
                                                           int max)
Get keywords from a text. This methods tries to detect which language it is in. When the language is not detected then all words are eligable to be a keyword.

Parameters:
text - - full text from which the keywords should be extracted
max - - maximum number of keywords returned
Returns:
keywords found in text

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.lang.String text,
                                                           java.lang.String[] ignoreWords,
                                                           int max)
Get keywords from a text

Parameters:
text - - full text from which the keywords should be extracted
ignoreWords - - ignore the words in this array
max - - maximum number of keywords returned
Returns:
keywords found in text

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings)
Get keywords from the strings. This methods tries to detect which language it is in. When the language is not detected then all words are eligable to be a keyword.

Parameters:
textStrings - - strings from which the keywords should be extracted
Returns:
keywords found in strings

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings,
                                                           java.lang.String language)
Get keywords from the strings

Parameters:
textStrings - - strings from which the keywords should be extracted
language - - When the language is not recognized then all words are eligable to be a keyword.
Returns:
keywords found in strings

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings,
                                                           java.lang.String language,
                                                           int max)
Get keywords from the strings

Parameters:
textStrings - - strings from which the keywords should be extracted
language - - When the language is not recognized then all words are eligable to be a keyword.
max - - maximum number of keywords returned
Returns:
keywords found in strings

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings,
                                                           int max)
Get keywords from the strings. This methods tries to detect which language it is in. When the language is not detected then all words are eligable to be a keyword.

Parameters:
textStrings - - strings from which the keywords should be extracted
max - - maximum number of keywords returned
Returns:
keywords found in strings

getKeywords

public static java.util.List<java.lang.String> getKeywords(java.util.List<java.lang.String> textStrings,
                                                           java.lang.String[] ignoreWords,
                                                           int max)
Get keywords from the strings

Parameters:
textStrings - - strings from which the keywords should be extracted
ignoreWords - - ignore the words in this array
max - - maximum number of keywords returned
Returns:
keywords found in strings

getCommonWords

public static java.lang.String[] getCommonWords(java.lang.String text)

detectLanguage

public static java.lang.String detectLanguage(java.lang.String text)


Copyright © 2003-2006 mmapps. All Rights Reserved.