|
7 | 7 | You need [uv](https://docs.astral.sh/uv/) and a Python that satisfies `>=3.11`. |
8 | 8 |
|
9 | 9 | 1. Create a virtual environment with a fixed Python version (run this in the directory where you want `.venv`, e.g. the repo root for a clone): |
10 | | - |
11 | 10 | ```bash |
12 | 11 | uv venv --python 3.11 # or 3.12 or 3.13 |
13 | 12 | ``` |
14 | | - |
15 | | -1. Activate it. On Linux or macOS: |
16 | | - |
| 13 | +2. Activate it. On Linux or macOS: |
17 | 14 | ```bash |
18 | 15 | source .venv/bin/activate |
19 | 16 | ``` |
20 | | - |
21 | 17 | On Windows, use `.venv\Scripts\activate` (cmd) or `.\.venv\Scripts\Activate.ps1` (PowerShell). |
22 | 18 | 3. Install into that environment, using the published package from PyPI: |
23 | | - |
24 | 19 | ```bash |
25 | 20 | uv pip install dynamicsyntax |
26 | 21 | ``` |
27 | 22 |
|
28 | 23 | ## Examples |
29 | 24 |
|
30 | | -For some code examples of the parser in action, check out this notebook: [](https://colab.research.google.com/drive/1ofpCLwLOE88AvbtR3gh5uisaYkpWGNP9?usp=sharing) |
| 25 | +For some code examples of how to use the parser in action, check out this notebook: [Open In Colab](https://colab.research.google.com/drive/1ofpCLwLOE88AvbtR3gh5uisaYkpWGNP9?usp=sharing) |
| 26 | + |
| 27 | +### Quickstart |
| 28 | + |
| 29 | +```python |
| 30 | +import dynamicsyntax as ds |
| 31 | + |
| 32 | +p = ds.parse("a man knows you", "ttr") |
| 33 | +print(p.semantics) # TTR semantics based on the default grammar/lexicon |
| 34 | +print(p.vis()) # Visualise the parse tree |
| 35 | +``` |
31 | 36 |
|
32 | 37 | ## Get Involved |
33 | 38 |
|
34 | 39 | Contributions (issues, PRs, [donations (spent on coffee/LLM credits!)](https://buymeacoffee.com/incrementaliser)) are very welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more details. |
35 | 40 |
|
36 | 41 | **Note** |
37 | | -Since this project has been translated using Cursor and tested only on Windows, there is a small chance errors exist. I would be grateful if you could report them to me through the above channels. Although, it is important to mention that some of the most critical methods here have been verified via unit tests, so there is a high chance the migration from Java has been correct so far. |
| 42 | +Since this project has been translated using Cursor and tested only on Windows, there is a small chance errors exist. I would be grateful if you could report them to me through the above channels. Although, it is important to mention that some of the most critical methods here have been verified via unit tests, so there is a high chance the migration from Java has been correct so far. |
0 commit comments