Skip to content

Commit 69746ce

Browse files
committed
add fst annotations
1 parent 1f312ef commit 69746ce

File tree

4 files changed

+271
-178
lines changed

4 files changed

+271
-178
lines changed

pyformlang/finite_automaton/finite_automaton.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,14 @@ def to_fst(self) -> FST:
436436
"""
437437
fst = FST()
438438
for start_state in self._start_states:
439-
fst.add_start_state(start_state.value)
439+
fst.add_start_state(start_state)
440440
for final_state in self._final_states:
441-
fst.add_final_state(final_state.value)
441+
fst.add_final_state(final_state)
442442
for s_from, symb_by, s_to in self._transition_function:
443-
fst.add_transition(s_from.value,
444-
symb_by.value,
445-
s_to.value,
446-
[symb_by.value])
443+
fst.add_transition(s_from,
444+
symb_by,
445+
s_to,
446+
[symb_by])
447447
return fst
448448

449449
def is_acyclic(self) -> bool:

pyformlang/fst/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
1313
"""
1414

15-
from .fst import FST
15+
from .fst import FST, State, Symbol, Epsilon
1616

1717

18-
__all__ = ["FST"]
18+
__all__ = ["FST",
19+
"State",
20+
"Symbol",
21+
"Epsilon"]

0 commit comments

Comments
 (0)