-
Notifications
You must be signed in to change notification settings - Fork 17
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
Lazy FstProperties + num_{input,output}_epsilons #113
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…se of set_final_weight when modifying a final weight which modifies the property bits correctly
…fix POS_TRINARY and NEG_TRINARY
…blic) associated constants
Garvys
force-pushed
the
task/lazy_fst_properties
branch
from
May 25, 2020 12:14
45ea42b
to
7d1e96c
Compare
…_weights=false and encode_labels=false
# Conflicts: # rustfst/src/tests_openfst/mod.rs
…ertain properties to be known
…d implement them for all Fsts
Lazy num_{in,out}put_epsilons
Garvys
changed the title
Lazy FstProperties
Lazy FstProperties + num_{input,output}_epsilons
Jun 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal1 : Make the
fst.properties()
method behave similary in rustfst and in openfst. At the moment, in rustfst all the properties are re-computed each time theproperties
method is called. To do that, we need to iterate over the whole graph which is slow.However, in openfst the properties are stored in the
Fst
object and modified each time a mutable operation is performed.Goal2 : Maje the
fst.num_input_epsilons()
andfst.num_output_epsilons()
methods behave similarly in rustfst and in openfst i.e by maintaining internal counters instead of iterating through all the Trs.Added
compute_and_update_properties()
method toMutableFst
trait to compute the properties verified by theFst
and update the internal property bits.Changed
fst.properties()
method returns the stored property bits instead of computing all the verified properties.tr_sort
no longer need a sorting closure but a struct implementingTrCompare
.ilabel_compare
->ILabelCompare
olabel_compare
->OLabelCompare
num_input_epsilons
andnum_output_epsilons
are now required methods of theCoreFst
trait instead of provided.num_input_epsilons
andnum_output_epsilons
are now much faster as they leverage internal counters instead of iterating through the Trs.