Page MenuHomeWickedGov Phorge

ReadableTtmServer.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

ReadableTtmServer.php

<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\TtmServer;
/**
* Interface for TtmServer that can be queried (=all of them).
* @ingroup TTMServer
*/
interface ReadableTtmServer {
/**
* Fetches all relevant suggestions for given text.
*
* @param string $sourceLanguage language code for the provide text
* @param string $targetLanguage language code for the suggestions
* @param string $text the text for which to search suggestions
* @return 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
*/
public function query( string $sourceLanguage, string $targetLanguage, string $text ): array;
/**
* Determines if the suggestion returned by this TtmServer comes
* from this wiki or any other wiki.
*/
public function isLocalSuggestion( array $suggestion ): bool;
/**
* Given suggestion returned by this TtmServer, constructs fully
* qualified URL to the location of the translation.
* @return string URL
*/
public function expandLocation( array $suggestion ): string;
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 21:15 (5 d, 12 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a4/87/495c4651bf376c98dcf174c587f2
Default Alt Text
ReadableTtmServer.php (1 KB)

Event Timeline