semvec/pypi-packages huggingface dataset:
app-global 1.0.0
Sharing global variables between modules in a Python application
License: MIT
Requires Python: >=3.7.9,<4.0.0

# app_global

From [docs.python.org](https://docs.python.org/3/faq/programming.html?highlight=global#how-do-i-share-global-variables-across-modules):

"The canonical way to share information across modules within a single program is to create a special module (often called config or cfg). Just import the config module in all modules of your application; the module then becomes available as a global name. Because there is only one instance of each module, any changes made to the module object get reflected everywhere. For example:"

<br>

See /Example/app_global_test for an illustration that can be run in VSCode

<br>

Although not illustrated, it is recommended to categorize data within the app globals to keep organized and thus reduce possiblity obscure failure:
* config.C - For global constants
* config.G - For global application state like DB connections, caches etc.
* config.opts - Application options
* config.log - Application logger
* config.printCli - Common print cli handler for clean exit during initialization

<br>

As with any global data, care should be taken when using from within any multi threading applications. Use appropriate locking mechanisms as required.

<br>

Besides improving documentation, the main source `config.py` will be left as an empty source file so that is infinitely flexible
PyParseEarley 1.0.1
Yet Another Earley Parser: Efficient parsing algorithm for context-free grammars.
License: MIT
Requires Python: >=3.5

# YAEP (Yet Another Earley Parser)

YAEP (Yet Another Earley Parser) is a high-performance package parsing syntax trees from Context-Free Grammars (CFGs). It implements the efficient Earley parsing algorithm, supporting ambiguity and generating comprehensive syntax trees. Designed for natural language processing (NLP) tasks, YAEP bridges theory and practice, providing computational linguists with a reliable tool for linguistic research and NLP applications.

## Features
- Efficient parsing of CFGs
- Support for ambiguous and non-deterministic grammar
- Generation of comprehensive syntax trees
- Designed for NLP tasks and applications

## Install dependency
```bash
pip install CairoSVG pydot
```

## Getting Started
1. Define your CFG grammar in json format.
2. Utilize the YAEP API to parse sentences and generate syntax trees.

## Examples
```python
import YAEP
from YAEP import earley
from YAEP import utils

grammar = {
    'S': [['VP'], ['NP']],
    'VP': [['Verb']],
    'NP': [['Det', 'Nominal'], ['Proper-Noun'], ['Noun']],
    'Nominal': [['Noun'], ['Noun', 'Nominal']],
    'Det': [['that'], ['this'], ['a']],
    'Proper-Noun': [['Batman']],
    'Noun': [['book'], ['flight'], ['banana'], ['meal'], ['factory']],
    'Verb': [['book']],
}

words = "This book".split()
chart = earley.Earley().earley_parse(words, grammar)
parsed = [s for s in chart[-1] if s.left == 'S']

print(utils.tree_to_digraph(parsed[0],words))
```

## Contributions and Feedback
Contributions and feedback are welcome! Please open an issue or submit a pull request on the [YAEP GitHub repository](https://github.com/t3bol90/YAEP) for improvements, bug fixes, or suggestions.

## License
YAEP is licensed under the [MIT License](https://github.com/t3bol90/YAEP/blob/main/LICENSE). Feel free to use, modify, and distribute it according to the license terms.

## Acknowledgments
YAEP builds upon the valuable contributions in computational linguistics and parsing algorithms. We express our gratitude to the researchers and developers who have influenced and inspired the development of YAEP.

## Contact
For any inquiries or questions, please contact [toandd.i81@gmail.com](mailto:toandd.i81@gmail.com).

---

YAEP (Yet Another Earley Parser) is a high-performance package parsing syntax trees from Context-Free Grammars (CFGs). It provides efficient parsing, support for ambiguity, and comprehensive syntax tree generation for NLP tasks. Contributions and feedback are welcome. License: MIT. Contact: [toandd.i81@gmail.com](mailto:toandd.i81@gmail.com).