Package com.adobe.cq.smartcontent
Interface SmartContentAuthoringService
-
@ProviderType public interface SmartContentAuthoringServiceThis class implements a service that can be used to apply smart content authoring to a text.
Language/locale handling:
- An exact match (language + country) is preferred.
- If no exact match is found, language data available for the language is chosen.
- If there are neither matches for language and region, nor for language (without
region), a
SmartContentExceptionis thrown.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LanguageDatagetLanguageData(java.util.Locale locale)Determines the language data for the providedLocale.java.lang.Stringsummarize(java.lang.String inputString, int outputLen, LanguageData language)Creates a summarized version of the provided text.
-
-
-
Method Detail
-
getLanguageData
LanguageData getLanguageData(java.util.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;
nullif the specifiedLocaleis not supported
-
summarize
java.lang.String summarize(java.lang.String inputString, int outputLen, LanguageData language) throws SmartContentExceptionCreates 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 textoutputLen- The target length (in words); the actual result may contain less words, but not more than specified by this parameterlanguage- The language of the text, as returned bygetLanguageData(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
-
-