Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dcspark/pddl-ish-parser
https://github.com/dcspark/pddl-ish-parser
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcspark/pddl-ish-parser
- Owner: dcSpark
- License: mit
- Created: 2023-11-17T22:32:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-18T00:06:54.000Z (about 1 year ago)
- Last Synced: 2024-04-16T08:55:26.684Z (9 months ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDDL-ish Parser
The PDDL-ish Parser is a Rust library designed for parsing a relaxed version of the Planning Domain Definition Language (PDDL). This parser is particularly tailored for handling PDDL-like inputs that may be generated by autoregressive language models such as ChatGPT.
## Features
- Parse non-standard PDDL files with flexibility.
- Extract domains, objects, and actions from PDDL-like structured text.
- Error handling to provide context for parsing failures.
- Support for common PDDL constructs with leniency in syntax.## Installation
To install the PDDL-ish Parser, you can use `cargo add` command:
```bash
cargo add pddl-ish-parser
```Or add the following to your Cargo.toml file:
```toml
pddl-ish-parser = "0.0.3"
```You may want to check on the latest available version on [crates.io](https://crates.io/crates/pddl-ish-parser).
## Usage
Here is a basic example of how to use the PDDL-ish Parser:
```rust
use pddl_ish_parser::parser::problem_parser::parse_problem;fn main() {
let input = r#"(define (problem your-problem)
...
)"#;match parse_problem(input) {
Ok((_, problem)) => println!("{:?}", problem),
Err(e) => eprintln!("Error parsing problem: {:?}", e),
}let domain_input = r#"(define (domain your-domain)
...
)"#;match parse_domain_types(domain_input) {
Ok((_, domain_types)) => println!("Parsed domain types: {:?}", domain_types),
Err(e) => eprintln!("Error parsing domain types: {:?}", e),
}
}
```## Testing
The library includes tests that you can run to ensure the parser works as expected:
```bash
cargo test
```## Contributions
Contributions are welcome! Please open an issue or pull request on GitHub.
## License
This project is licensed under the MIT License - see the LICENSE file for details.