Interface SmartContentAuthoringService


@ProviderType public interface SmartContentAuthoringService

This class implements a service that can be used to apply smart content authoring to a text.

Language/locale handling:

  1. An exact match (language + country) is preferred.
  2. If no exact match is found, language data available for the language is chosen.
  3. If there are neither matches for language and region, nor for language (without region), a SmartContentException is thrown.
  • Method Details

    • getLanguageData

      LanguageData getLanguageData(Locale locale)

      Determines the language data for the provided Locale.

      The method uses the resolution rules stated in the interface's documentation to match over-specific Locales to suitable language data.

      Parameters:
      locale - The locale
      Returns:
      The language data; null if the specified Locale is not supported
    • summarize

      String summarize(String inputString, int outputLen, LanguageData language) throws SmartContentException

      Creates a summarized version of the provided text.

      "Summarized" means that the text is reduced to a maximum of the provided number of words. The algorithm will use an algorithm to determine which parts of the original text can be dropped to reach the target length.

      Parameters:
      inputString - The original text
      outputLen - The target length (in words); the actual result may contain less words, but not more than specified by this parameter
      language - The language of the text, as returned by getLanguageData(Locale)
      Returns:
      The summarized text
      Throws:
      SmartContentException - if the text could not by summarized, for example if required language data (model, dictionaries, ...) were missing or an unsupported language was specified