15 private const EXCLUDED_APERTIUM_TARGET_LANGUAGES = [
'fr',
'es',
'nl' ];
17 protected function handlePairsForService( array $response ): array {
19 foreach ( $response[$this->getServiceName()] as $source => $targets ) {
20 $filteredTargets = array_diff( $targets, self::EXCLUDED_APERTIUM_TARGET_LANGUAGES );
21 foreach ( $filteredTargets as $target ) {
22 $pairs[$source][$target] =
true;
29 protected function handleServiceResponse( array $responseBody ):
string {
30 $text = $responseBody[
'contents' ];
31 if ( preg_match(
'~^<div>(.*)</div>$~', $text ) ) {
32 $text = preg_replace(
'~^<div>(.*)</div>$~',
'\1', $text );
38 protected function getServiceName():
string {