DatabaseTTMServer Class Reference
[The Translate extension translation memory interface]

Mysql based backend. More...

Inheritance diagram for DatabaseTTMServer:
Inheritance graph
[legend]
Collaboration diagram for DatabaseTTMServer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 update (MessageHandle $handle, $targetText)
 Shovels the new translation into translation memory.
 beginBootstrap ()
 Called when starting to fill the translation memory.
 beginBatch ()
 Called before every batch (MessageGroup).
 batchInsertDefinitions (array $batch)
 Called multiple times per batch if necessary.
 batchInsertTranslations (array $batch)
 Called multiple times per batch if necessary.
 endBatch ()
 Called before every batch (MessageGroup).
 endBootstrap ()
 Do any cleanup, optimizing etc.
 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.
 query ($sourceLanguage, $targetLanguage, $text)
 Fetches all relevant suggestions for given text.

Protected Member Functions

 getDB ($mode=DB_SLAVE)
 insertSource (Title $context, $sourceLanguage, $text)
 filterForFulltext ($language, $input)
 Tokenizes the text for fulltext search.
 processQueryResults ($res, $text, $targetLanguage)

Protected Attributes

 $sids

Detailed Description

Mysql based backend.

Since:
2012-06-27

Definition at line 17 of file DatabaseTTMServer.php.


Member Function Documentation

DatabaseTTMServer::batchInsertDefinitions ( array $  batch  ) 

Called multiple times per batch if necessary.

Implements WritableTTMServer.

Definition at line 164 of file DatabaseTTMServer.php.

Here is the call graph for this function:

DatabaseTTMServer::batchInsertTranslations ( array $  batch  ) 

Called multiple times per batch if necessary.

Implements WritableTTMServer.

Definition at line 174 of file DatabaseTTMServer.php.

Here is the call graph for this function:

DatabaseTTMServer::beginBatch (  ) 

Called before every batch (MessageGroup).

Implements WritableTTMServer.

Definition at line 160 of file DatabaseTTMServer.php.

DatabaseTTMServer::beginBootstrap (  ) 

Called when starting to fill the translation memory.

Set up necessary variables and remove old content from the server.

Implements WritableTTMServer.

Definition at line 146 of file DatabaseTTMServer.php.

Here is the call graph for this function:

DatabaseTTMServer::endBatch (  ) 

Called before every batch (MessageGroup).

Implements WritableTTMServer.

Definition at line 190 of file DatabaseTTMServer.php.

DatabaseTTMServer::endBootstrap (  ) 

Do any cleanup, optimizing etc.

Implements WritableTTMServer.

Definition at line 193 of file DatabaseTTMServer.php.

Here is the call graph for this function:

DatabaseTTMServer::expandLocation ( array $  suggestion  ) 

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

Parameters:
array $suggestion
Returns:
String URL

Implements ReadableTTMServer.

Definition at line 205 of file DatabaseTTMServer.php.

DatabaseTTMServer::filterForFulltext ( language,
input 
) [protected]

Tokenizes the text for fulltext search.

Tries to find the most useful tokens.

Definition at line 117 of file DatabaseTTMServer.php.

Referenced by insertSource(), and query().

Here is the call graph for this function:

DatabaseTTMServer::getDB ( mode = DB_SLAVE  )  [protected]
Parameters:
$mode int DB_SLAVE|DB_MASTER
Returns:
DatabaseBase

Definition at line 24 of file DatabaseTTMServer.php.

Referenced by batchInsertTranslations(), beginBootstrap(), endBootstrap(), insertSource(), query(), and update().

DatabaseTTMServer::insertSource ( Title $  context,
sourceLanguage,
text 
) [protected]

Definition at line 86 of file DatabaseTTMServer.php.

Referenced by batchInsertDefinitions(), and update().

Here is the call graph for this function:

DatabaseTTMServer::isLocalSuggestion ( array $  suggestion  ) 

Determines if the suggestion returned by this TTMServer comes from this wiki or any other wiki.

Parameters:
array $suggestion
Returns:
Bool

Implements ReadableTTMServer.

Definition at line 201 of file DatabaseTTMServer.php.

DatabaseTTMServer::processQueryResults ( res,
text,
targetLanguage 
) [protected]

Definition at line 245 of file DatabaseTTMServer.php.

Referenced by query().

Here is the call graph for this function:

DatabaseTTMServer::query ( sourceLanguage,
targetLanguage,
text 
)

Fetches all relevant suggestions for given text.

Parameters:
$sourceLanguage String: language code for the provide text
$targetLanguage String: language code for the suggestions
$text String: the 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

Implements ReadableTTMServer.

Definition at line 211 of file DatabaseTTMServer.php.

Here is the call graph for this function:

DatabaseTTMServer::update ( MessageHandle handle,
targetText 
)

Shovels the new translation into translation memory.

Use this for single updates (=after message edit). If no text is provided, entry will be removed from the translation memory.

Parameters:
MessageHandle $handle
string|null $targetText Use null to only delete.

Implements WritableTTMServer.

Definition at line 28 of file DatabaseTTMServer.php.

Here is the call graph for this function:


Member Data Documentation

DatabaseTTMServer::$sids [protected]

Definition at line 18 of file DatabaseTTMServer.php.


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:45 2013 for MediaWiki Translate Extension by  doxygen 1.6.3