Skip to content

Commit

Permalink
docs: add inversion and fix some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Aug 15, 2024
1 parent bd4cf05 commit 9c25484
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion rustfst-python/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ nav:
- rustfst/algorithms/rm_epsilon/index.md
- reverse:
- rustfst/algorithms/reverse/index.md
- inversion:
- rustfst/algorithms/inversion/index.md
- project:
- rustfst/algorithms/project/index.md
- randgen:
Expand Down Expand Up @@ -83,7 +85,7 @@ plugins:
show_signature_annotations: true
show_submodules: true
watch:
- rustfst-python/rustfst
- rustfst
- docs
repo_name: rustfst
repo_url: https://github.com/Garvys/rustfst
Expand Down
14 changes: 9 additions & 5 deletions rustfst-python/rustfst/algorithms/tr_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@


def tr_sort(fst: VectorFst, ilabel_cmp: bool):
"""
tr_sort(fst)
sort fst trs according to their ilabel or olabel
:param fst: Fst
:param ilabel_cmp: bool
"""Sort fst trs in place according to their input or output label.
This is often necessary for composition to work properly. It
corresponds to `ArcSort` in OpenFST.
Args:
fst: FST to be tr-sorted
ilabel_cmp: Sort on input labels if `True`, output labels
if `False`.
"""

ret_code = lib.fst_tr_sort(fst.ptr, ctypes.c_bool(ilabel_cmp))
Expand Down

0 comments on commit 9c25484

Please sign in to comment.