PHPackages                             enl/moses-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. enl/moses-php-client

ActiveLibrary

enl/moses-php-client
====================

PHP Client for Moses xml-rpc server. Moses is a machine translation system

v1.0.0(10y ago)11.4k1GPL-3.0+PHP

Since Dec 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/enl/moses-php-client)[ Packagist](https://packagist.org/packages/enl/moses-php-client)[ RSS](/packages/enl-moses-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Moses Client for PHP
====================

[](#moses-client-for-php)

This package is a simplest possible client for Moses xmlrpc server. Moses is a machine translation system. You can read more about it on [its official website](http://statmt.org/moses).

Installation
------------

[](#installation)

The best way to install the package is to install it via [composer](http://getcomposer.org). If you're still not using this awesome manager it's right time to start!

```
composer require enl/moses-php-client

```

Or you can add the following string to your `composer.json` by hand:

```
{
    "require": {
        "enl/moses-php-client": "~1.0"
    }
}

```

And run `composer update`.

Usage
-----

[](#usage)

First of all, you need to instantiate the Client:

```
use Enl\MosesClient\Client;
use Enl\MosesClient\Transport;

$transport = new Transport('http://your-moses-server.ltd:8080/RPC2');
$client = new Client($transport);

```

Or just use `Client::factory` method:

```
use Enl\MosesClient\Client;

$client = Client::factory('http://your-moses-server.ltd:8080/RPC2');

```

### How to translate a text

[](#how-to-translate-a-text)

Text translation is simple as this line of code:

```
$translation = $client->translate('Text to translate goes here.');

```

### Alignment option

[](#alignment-option)

Actually, `Client::translate` function takes two parameters. The second one is optional `align` `boolean` parameter:

```
$translation = $client->translate('Text to translate goes here.', $align);

```

What this parameter mean? The [official doc for Moses](http://www.statmt.org/moses/?n=Advanced.Moses) says the following:

> To access the Moses server, an XMLRPC request should be sent to  where the parameter is a map containing the keys `text` and (optionally) `align`. The value of the first of these parameters is the text to be translated and the second, if present, causes alignment information to be returned to the client. The client will receive a map containing the same two keys, where the value associated with the `text` key is the translated text, and the `align` key (if present) maps to a list of maps. The alignment gives the segmentation in target order, with each list element specifying the target start position (`tgt-start`), source start position (`src-start`) and source end position (`src-end`).

So, if you set `align` parameter as a `true`, you will get the array with `text` and `align` keys as a response and just text otherwise.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3803d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50587ee520f9c618e4663b3e62d04bace5458d30d8644c71a1e510ed94075e1a?d=identicon)[enl](/maintainers/enl)

---

Top Contributors

[![enl](https://avatars.githubusercontent.com/u/670322?v=4)](https://github.com/enl "enl (17 commits)")[![daenoor](https://avatars.githubusercontent.com/u/211334?v=4)](https://github.com/daenoor "daenoor (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/enl-moses-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/enl-moses-php-client/health.svg)](https://phpackages.com/packages/enl-moses-php-client)
```

###  Alternatives

[gamenet/php-jabber-rpc

PHP wrapper for ejabberd xml-rpc module

1921.0k](/packages/gamenet-php-jabber-rpc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
