Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer Interface Reference

Interface for TTMServer that can be queried (=all of them). More...

Inheritance diagram for MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer:
ElasticSearchTTMServer FakeTTMServer MediaWiki\Extension\Translate\TtmServer\DatabaseTtmServer MediaWiki\Extension\Translate\TtmServer\FakeReadableTtmServer RemoteTTMServer

Public Member Functions

 query (string $sourceLanguage, string $targetLanguage, string $text)
 Fetches all relevant suggestions for given text.
 
 isLocalSuggestion (array $suggestion)
 Determines if the suggestion returned by this TTMServer comes from this wiki or any other wiki.
 
 expandLocation (array $suggestion)
 Given suggestion returned by this TTMServer, constructs fully qualified URL to the location of the translation.
 

Detailed Description

Interface for TTMServer that can be queried (=all of them).

Definition at line 10 of file ReadableTtmServer.php.

Member Function Documentation

◆ expandLocation()

MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer::expandLocation ( array $suggestion)

Given suggestion returned by this TTMServer, constructs fully qualified URL to the location of the translation.

Returns
string URL

Implemented in MediaWiki\Extension\Translate\TtmServer\DatabaseTtmServer, MediaWiki\Extension\Translate\TtmServer\FakeReadableTtmServer, ElasticSearchTTMServer, FakeTTMServer, and RemoteTTMServer.

◆ isLocalSuggestion()

MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer::isLocalSuggestion ( array $suggestion)

◆ query()

MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer::query ( string $sourceLanguage,
string $targetLanguage,
string $text )

Fetches all relevant suggestions for given text.

Parameters
string$sourceLanguagelanguage code for the provide text
string$targetLanguagelanguage code for the suggestions
string$textthe text for which to search suggestions
Returns
array List: unordered suggestions, which each has fields:
  • source: String: the original text of the suggestion
  • target: String: the suggestion
  • context: String: title of the page where the suggestion comes from
  • quality: Float: the quality of suggestion, 1 is perfect match

Implemented in MediaWiki\Extension\Translate\TtmServer\DatabaseTtmServer, MediaWiki\Extension\Translate\TtmServer\FakeReadableTtmServer, ElasticSearchTTMServer, FakeTTMServer, and RemoteTTMServer.


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