A French-English text realisator
Reason this release was yanked:
unsuccessful install which proved to be unusable
Project description
pyRealB - A Python Bilingual Text Realizer
Version 1.0 - December 2021
pyRealB is a Python adaptation of the JavaScript jsRealB with the same dependency syntax notation. It facilitates its integration within Python applications by simply adding
from pyRealB import *
CAUTION: some directories include markup.py
which should be loaded using pip
. Unfortunately I never managed to make this "piped" version work,it does not import the name oneliner
although it should. It works once the file is in the local directory.
Program files
pyRealB.py
: main program that exports all relevant symbols and defines a few utility functions.
Running this file will exercise a few typical functions, but usually it isimport
ed.Constituent.py
: Constituent is the top class for methods shared between Phrases and TerminalsLexicon.py
: class to access lexicon entries and syntactic rulesNumber.py
: utility functions for dealing with number formattingPhrase.py
: subclass of Constituent for creating complex phrasesTerminal.py
: subclass of Constituent for creating a single unit (most often a single word)Warnings.py
: function to generate warnings in case of erroneous specifications using pyRealB itself
Directories
-
data
:lexicon-en.json
: English lexicon (33,926 entries) in json formatrule-en.js
: English conjugation and declension tableslexicon-fr.json
: French lexicon (52,512 entries) in json formatrule-fr.js
: French conjugation and declension tables
-
Documentation
: in both English and French.documentation.html
: generated documentation (used for consultation)documentation.py
: Python program for generatingdocumentation.html
usingmarkup.py
style.css
: style sheet for the documentationuserinfos.py
: definitions of variables containing the examplesuser.js
: Python helper script.
-
IDE
: Integrated Development EnvironmentpyRealB_ide.py
: built on the Python read-eval-print loop, it imports pyRealB to get the realization of an expression, to consult the lexicon, the conjugation and declension tables. It is also possible to get a lemmatization: i.e. the pyRealB expression corresponding to a form.pyReealB_ide.html
: documentation and examples
-
Tests
: unit tests of special features of pyRealB in both French and English. Files have the pattern*_{en|fr}.py
test.py
: simplistic function to check if a function the expected answertestAll.html
: run this file to run all tests
Demos
EvenementsDemo/evenements.py
: Description (in French) of a list of events, it creates HTML.InflectionDemo/inflection.py
: French or English conjugation and declension of a form.RandomGenDemo/RandomGen.py
: Generation of random English sentencesVariantesDemo/variantes.py
: French or English sentences realized with all possible sentence modifiers; some challenging examples are inexamples.py
WeatherDemo/Bulletin.py
: French and English weather bulletins generated from information in a json-line file (weather-data.jsonl
)
Contact
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.