Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\WebService\ApertiumWebService Class Reference

Implements support Apetrium translator api. More...

Inheritance diagram for MediaWiki\Extension\Translate\WebService\ApertiumWebService:
MediaWiki\Extension\Translate\WebService\TranslationWebService

Public Member Functions

 __construct (HttpRequestFactory $httpRequestFactory, string $serviceName, array $config)
 
 getType ()
 @inheritDoc
 
- Public Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 getName ()
 Gets the name of this service, for example to display it for the user.
 
 getQueries (string $text, string $sourceLanguage, string $targetLanguage)
 Get queries for this service.
 
 getResultData (TranslationQueryResponse $response)
 Get the web service specific response returned by QueryAggregator.
 
 __construct (string $service, array $config)
 
 isSupportedLanguagePair (string $sourceLanguage, string $targetLanguage)
 Test whether given language pair is supported by the service.
 
 setLogger (LoggerInterface $logger)
 
 checkTranslationServiceFailure ()
 Checks whether the service has exceeded failure count.
 

Protected Member Functions

 mapCode (string $code)
 @inheritDoc
 
 doPairs ()
 @inheritDoc
 
 getQuery (string $text, string $sourceLanguage, string $targetLanguage)
 @inheritDoc
 
 parseResponse (TranslationQueryResponse $reply)
 @inheritDoc
 
- Protected Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 getSupportedLanguagePairs ()
 
 wrapUntranslatable (string $text)
 Some mangling that tries to keep some parts of the message unmangled by the translation service.
 
 unwrapUntranslatable (string $text)
 Undo the hopyfully untouched mangling done by wrapUntranslatable.
 
 reportTranslationServiceFailure (string $msg)
 Increases the failure count for this service.
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
static factory (string $serviceName, array $config)
 Get a webservice handler.
 
- Protected Attributes inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 $service
 
 $config
 
 $logger
 
 $serviceFailureCount = 5
 
 $serviceFailurePeriod = 900
 

Detailed Description

Implements support Apetrium translator api.

Author
Niklas Laxström @license GPL-2.0-or-later
Since
2013-01-01
See also
https://wiki.apertium.org/wiki/Apertium_web_service

Definition at line 20 of file ApertiumWebService.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\WebService\ApertiumWebService::__construct ( HttpRequestFactory $httpRequestFactory,
string $serviceName,
array $config )

Definition at line 24 of file ApertiumWebService.php.

Member Function Documentation

◆ doPairs()

MediaWiki\Extension\Translate\WebService\ApertiumWebService::doPairs ( )
protected

@inheritDoc

Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.

Definition at line 44 of file ApertiumWebService.php.

◆ getQuery()

MediaWiki\Extension\Translate\WebService\ApertiumWebService::getQuery ( string $text,
string $sourceLanguage,
string $targetLanguage )
protected

@inheritDoc

Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.

Definition at line 68 of file ApertiumWebService.php.

◆ getType()

MediaWiki\Extension\Translate\WebService\ApertiumWebService::getType ( )

@inheritDoc

Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.

Definition at line 34 of file ApertiumWebService.php.

◆ mapCode()

MediaWiki\Extension\Translate\WebService\ApertiumWebService::mapCode ( string $code)
protected

@inheritDoc

Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.

Definition at line 39 of file ApertiumWebService.php.

◆ parseResponse()

MediaWiki\Extension\Translate\WebService\ApertiumWebService::parseResponse ( TranslationQueryResponse $reply)
protected

@inheritDoc

Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.

Definition at line 88 of file ApertiumWebService.php.


The documentation for this class was generated from the following file: