Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation-related changes for new release (docstrings) #199

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lambeq/backend/grammar.py
Original file line number Diff line number Diff line change
@@ -1914,14 +1914,14 @@ class Functor:
>>> diag.draw(
... figsize=(2, 2), path='./snake.png')

.. image:: ./_static/images/snake.png
.. image:: ../_static/images/snake.png
:align: center

>>> F = Functor(grammar, lambda _, ty : ty @ ty)
>>> F(diag).draw(
... figsize=(2, 2), path='./snake-2.png')

.. image:: ./_static/images/snake-2.png
.. image:: ../_static/images/snake-2.png
:align: center

"""
32 changes: 16 additions & 16 deletions lambeq/backend/pregroup_tree.py
Original file line number Diff line number Diff line change
@@ -45,28 +45,28 @@ class PregroupTreeNode:
and the branches of the tree represent cups identifying
input wires (cups) to the parent node.

Example
-------
Examples
--------
Consider the sentence "John gave Mary a flower", with the
following pregroup diagram:

```
John gave Mary a flower
──── ───────────── ──── ───── ──────
n n.r·s·n.l·n.l n n·n.l n
╰────╯ │ │ ╰────╯ │ ╰─────╯
│ ╰─────────────╯
```
.. code-block:: console

John gave Mary a flower
──── ───────────── ──── ───── ──────
n n.r·s·n.l·n.l n n·n.l n
╰────╯ ╰────╯ │ ╰─────╯
│ ╰─────────────╯

The tree for this diagram becomes:

```
gave_1 (s)
├ John_0 (n)
├ Mary_2 (n)
└ a_3 (n)
flower_4 (n)
```
.. code-block:: console

gave_1 (s)
├ John_0 (n)
├ Mary_2 (n)
a_3 (n)
└ flower_4 (n)

where the numbers after the underscore indicate the order of each
word in the sentence. This representation is sufficient for
Loading