Skip to content

Commit

Permalink
Documentation-related changes for new release (docstrings) (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkart authored Dec 10, 2024
1 parent c680f78 commit 0583068
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lambeq/backend/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
32 changes: 16 additions & 16 deletions lambeq/backend/pregroup_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0583068

Please sign in to comment.