org.activemath.content
Class NLG

java.lang.Object
  extended by org.activemath.content.NLG

public class NLG
extends Object

The class contains methods used for Natural Language Generation, e.g., title generation, bridge texts, etc.


Field Summary
protected static Logger log
           
static String regex_TITLE
          We define here the regular expression for a title, the case is assumed to be lower case.
 
Constructor Summary
NLG()
           
 
Method Summary
static String generateBridgeText(Item before, Item behind)
          This method generate the bridge text between two Content Items of a Book.
static Map generateContentMap(String phrase)
          Returns text.NLGGenerator.
static Map generateMapForPhrase(String phrase)
          Returns phrase in all available languages.
static String generateText(String lang, String phrase)
          Returns the text of the phrase in the given language.
static Map<String,String> generateTextMap(String userId, String queryname, List<String> contentIds)
          generate text for given user and queryname and contentIds.
static Map generateTitleMap(String phrase)
          Returns text.NLGGenerator.
static Map generateTitleMapForContentId(String contentId)
          Currently we check the type of the contentId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log

regex_TITLE

public static final String regex_TITLE
We define here the regular expression for a title, the case is assumed to be lower case. This String can be always expanded to more cases for more languages.

See Also:
Constant Field Values
Constructor Detail

NLG

public NLG()
Method Detail

generateTitleMapForContentId

public static Map generateTitleMapForContentId(String contentId)
Currently we check the type of the contentId. If it starts with Mbase signature, then we call the mbase to get the title Map. Otherwise we use Mediator to get the title by calling the propriate repository. More generally and logically, we should just call the mediator to find the propriate repository to get the title. But there's some factors we considered:

Parameters:
contentId -
Returns:
A Map of Titles

generateBridgeText

public static String generateBridgeText(Item before,
                                        Item behind)
This method generate the bridge text between two Content Items of a Book. It is not yet implemented

Parameters:
before -
bebind -
Returns:
BridgeText

generateText

public static String generateText(String lang,
                                  String phrase)
Returns the text of the phrase in the given language.


generateTextMap

public static Map<String,String> generateTextMap(String userId,
                                                 String queryname,
                                                 List<String> contentIds)
generate text for given user and queryname and contentIds.

Parameters:
userId -
queryname -
contentIds -
Returns:

generateTitleMap

public static Map generateTitleMap(String phrase)
Returns text.NLGGenerator.phrase.Title in all available languages.


generateContentMap

public static Map generateContentMap(String phrase)
Returns text.NLGGenerator.phrase.Content in all available languages.


generateMapForPhrase

public static Map generateMapForPhrase(String phrase)
Returns phrase in all available languages.