Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mbrioski/aiml

PHP >=7.3 library for AIML files
https://github.com/mbrioski/aiml

aiml aiml-interpreter php php73

Last synced: 1 day ago
JSON representation

PHP >=7.3 library for AIML files

Awesome Lists containing this project

README

        

AIML library for php
---
[![Build Status](https://travis-ci.org/ridesoft/AIML.svg?branch=master)](https://travis-ci.org/ridesoft/Aiml-parser)

Aiml Php library for php, compatible with Php 7.3>=.

AIML stands for Artificial Intelligence Modelling Language. AIML is an XML based markup language meant to create
artificial intelligent applications.

[AIML Reference](https://www.pandorabots.com/docs/aiml-reference/)

## Supported language tags
* ``
* ``
* ``
* ``

## How install it

`composer require ridesoft/aiml:~0.1.0`

## Base usage example

You can find this example in the [robot.php](tests/robot.php) file.
Run it with `docker run -v ${PWD}:/var/www/html --rm -it php:7.4-fpm-alpine sh -c "php tests/robot.php"`

```
setAimlFile(__DIR__ . '/files/simple.aiml')
->getCategory('Hello Aiml')
->getTemplate() . "\n";

$file2 = new \Ridesoft\AIML\File();
$category = $file2->setAimlFile(__DIR__ . '/files/srai.aiml')
->getCategory('Who Mauri is?');

echo "Who Mauri is? \n";
if ($category->isTemplateSrai()) {
echo $file2->getCategory($category->getTemplate($category->getStars()))
->getTemplate(). "\n";
}
```

## Contributing
I develop this library in my free time: any help is really welcome: i would like in any case to follow the best practise
using a TDD approach or at least write unit tests for the code.

The code follow PSR2 standards.

### Check coding standards

```
docker run -v ${PWD}:/var/www/html --rm -it php:7.4-fpm-alpine vendor/bin/phpcs --standard=PSR2 /var/www/html/src
```

### Run unit test (using docker)

Spin up php7.4 container with:
```
docker run -v ${PWD}:/var/www/html --rm -it php:7.4-fpm-alpine vendor/bin/phpunit
```