An open API service indexing awesome lists of open source software.

https://github.com/hctilg/number-to-text

converts numbers to persian text.
https://github.com/hctilg/number-to-text

api number-to-text persian-nlp php

Last synced: about 1 year ago
JSON representation

converts numbers to persian text.

Awesome Lists containing this project

README

          

# number-to-text

converts numbers to persian text.

## Usage

### Library

Simply use:

```php
// checking the exists Library.
if (!file_exists("number-to-text.php")) {
copy('https://raw.githubusercontent.com/hctilg/number-to-text/main/number-to-text.php', 'number-to-text.php');
}

// require Library.
require_once('number-to-text.php');

$input = '';

$output = number_to_text($input);

echo "Text: $output";
```

### API

Send requests to `/number-to-text.php`.

| Method | Parameter |
|:---------|:---------:|
| GET/POST | `string` number |

![Preview](images/preview-api.jpg)

### CLI

run php script:

```bash
php number-to-text.php
```

![Preview](images/preview-cli.jpg)


## Test

### Web

Go to the `./number-to-text` folder and run php localhost:

```bash
php -S localhost:6040
```

then open the following url

```
http://localhost:6040/test.php
```

![Preview](images/test-web.jpg)

### CLI

run php script:

```bash
php test.php
```

![Preview](images/test-cli.jpg)