Skip to content

Fix LT-21867: Optional contexts don't work properly in Hermit Crab#296

Closed
jtmaxwell3 wants to merge 5 commits intomasterfrom
LT-21867
Closed

Fix LT-21867: Optional contexts don't work properly in Hermit Crab#296
jtmaxwell3 wants to merge 5 commits intomasterfrom
LT-21867

Conversation

@jtmaxwell3
Copy link
Copy Markdown
Collaborator

@jtmaxwell3 jtmaxwell3 commented Mar 17, 2025

https://jira.sil.org/browse/LT-21867 reports that optional contexts don't work correctly. If a context is optional, then it should accept anything. But the code to traverse fsts doesn't accept the empty string. I wasn't able to fix the code to traverse fsts, so I changed the context code to check whether the context accepts the empty string.


This change is Reviewable

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.47%. Comparing base (c5fa125) to head (1c1e7f1).

Files with missing lines Patch % Lines
src/SIL.Machine/FiniteState/Fst.cs 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #296   +/-   ##
=======================================
  Coverage   70.46%   70.47%           
=======================================
  Files         386      386           
  Lines       32256    32274   +18     
  Branches     4539     4542    +3     
=======================================
+ Hits        22729    22744   +15     
- Misses       8479     8481    +2     
- Partials     1048     1049    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely a bug in the Fst class. The class should properly handle the case where the start state is accepting. I would prefer that the Fst class is fixed. I took a stab at getting it to work in this PR. Let me know if it fixes the issue.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jtmaxwell3)

@jtmaxwell3
Copy link
Copy Markdown
Collaborator Author

Fixing the Fst class is a better solution, and it seems to work. Thanks! You can delete this pull request.

@Enkidu93
Copy link
Copy Markdown
Collaborator

Fixing the Fst class is a better solution, and it seems to work. Thanks! You can delete this pull request.

Fixed in the other PR.

@Enkidu93 Enkidu93 closed this Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants