Python Implementation of SimpleNLG
Project description
pySimpleNLG
A python port of SimpleNLG
This project is a direct port of the java code SimpleNLG v4.4.8 (released on Apr 10, 2016) to python. The port replicates (almost) all the classes and methods in the java API identically.
Documentation and Usage
The original project has a wiki tutorial and numerous examples on how to use the code. Since the API remains same, all of those examples are still valid and provide a great place to start. In addition, the test directory here has a large number of test cases you can use as examples.
The original java code has excellent javadoc documentation available here. Simply download a local copy and open index.html in your browser to view. The code comments were not ported into python so please use the original documentation.
Compatibility and Setup
The project is compatible with python version 3.4+. It will not work with python v2.x due to a few 3.x specific classes such as Enum. The code was built and tested under Ubuntu but should be compatible with Mac or Windows.
You don't need to install any additional libraries to run the code or execute the unit tests.
To install the code with pip do..
pip3 install simplenlg
Code Status
A few less commonly used components have been omitted. These include:
- Sentence "aggregation" components
- The "xmlrealiser"(s)
- The java server
- The NIHDBLexicon and MultipleLexicon classes
All implemented components are fully functional. The original project included about 175 unit-tests, all of which have been ported and pass in python.
The java code for SimpleNLG is not really that simple. It has large if/else statements, regex and other complexities that presented a number of opportunities for errors to creep in during the port. If you find a bug and are willing to fix it please do the following...
- Verify the correct behavior in the original java code.
- Identify the required python code changes needed to fix the issue so the behavior is the same as in java.
- Write a unit test under tests/misc to cover the changes.
- Use the provided script to run all unit tests and verify there is no adverse impact to other portions of the code.
- Submit a Pull Request (PR) here to merge the changes into the main codebase.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file simplenlg-0.2.0.tar.gz
.
File metadata
- Download URL: simplenlg-0.2.0.tar.gz
- Upload date:
- Size: 51.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc3b6490a32f83e9ec8920f2631981accf4c06ce7d796427e292a31e8250c856 |
|
MD5 | 49fa15916059fe82a609166ac7bee832 |
|
BLAKE2b-256 | 06424fbe010763a7f2a2db34aaa78be0baa4d7b8debfad745c6d0e3854e973a6 |
File details
Details for the file simplenlg-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: simplenlg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 165.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d258cf6e76a20c0dc97a10775632d32cdd00ef3f7fe1ae8c96c657c4e505e88 |
|
MD5 | 8418d6ed381e46078c517e3506e3f5f8 |
|
BLAKE2b-256 | fb812394ff7f3d562f2229e4b4859d66913296d96e409db1443f226aeaa840df |