PHP Class Swiftriver\GoogleLanguageServiceInterface\DetectionAndTranslationWorkflow

Show file Open project: ushahidi/Swiftriver-2011

Public Methods

Method Description
RunWorkflow ( Log $logger ) : Content When executed, this method will firstly attempt to identify the language that the content text is in. If this can not be done, then the workflow marks the language as unknown and returns the content. If a language is identified as being same as the base language, the text is marked with the language code and the content is returned. If the language is identified as something other than the base language, then translations are attempted and the translated text in the base language is added at position 0 to the content text collection while the original text is stored at position 1
__construct ( Content $content, string $referer, string $baseLanguageCode ) Constructor for this workflow

Private Methods

Method Description
ExtractTextForLanguageDetection ( $languageSpecificText )

Method Details

RunWorkflow() public method

When executed, this method will firstly attempt to identify the language that the content text is in. If this can not be done, then the workflow marks the language as unknown and returns the content. If a language is identified as being same as the base language, the text is marked with the language code and the content is returned. If the language is identified as something other than the base language, then translations are attempted and the translated text in the base language is added at position 0 to the content text collection while the original text is stored at position 1
public RunWorkflow ( Log $logger ) : Content
$logger Log
return Swiftriver\Core\ObjectModel\Content

__construct() public method

Constructor for this workflow
public __construct ( Content $content, string $referer, string $baseLanguageCode )
$content Swiftriver\Core\ObjectModel\Content
$referer string
$baseLanguageCode string