Skip to main content

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.

Metadata

Release files for simplenlg 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplenlg 0.2.0
File Size Uploaded
simplenlg-0.2.0.tar.gz 51.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simplenlg 0.2.0
File Interpreter ABI Platform
simplenlg-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 216.6 kB

Release files / simplenlg-0.2.0.tar.gz

Download URL simplenlg-0.2.0.tar.gz
Size 51.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bc3b6490a32f83e9ec8920f2631981accf4c06ce7d796427e292a31e8250c856
BLAKE2b-256 checksum
How to use checksums
06424fbe010763a7f2a2db34aaa78be0baa4d7b8debfad745c6d0e3854e973a6
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / simplenlg-0.2.0-py3-none-any.whl

Download URL simplenlg-0.2.0-py3-none-any.whl
Size 165.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d258cf6e76a20c0dc97a10775632d32cdd00ef3f7fe1ae8c96c657c4e505e88
BLAKE2b-256 checksum
How to use checksums
fb812394ff7f3d562f2229e4b4859d66913296d96e409db1443f226aeaa840df
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page