Repository navigation
Trace HermitCrab failure reasons and template slot outcomes #534
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
Open
johnml1135
wants to merge
9
commits into
master
Choose a base branch
from
fix/hc-trace-reasons
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,441
−34
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
efa6ed4
Trace HermitCrab failure reasons and template slot outcomes
johnml1135 5e9889b
Report new compounding rejections only to IDetailedTraceManager
johnml1135 4ad0979
Add a compatibility test that a plain ITraceManager receives the exis…
johnml1135 1ce2ca6
Restore MorphologicalRuleNotUnapplied for plain trace managers when a…
johnml1135 d294526
Stop sending plain trace managers the affix and realizational gate re…
johnml1135 149a19d
Pass the PartialParseFailure to the trace manager only when it is an …
johnml1135 df5ce44
Print the slot index and outcome of template slot traces in the Hermi…
johnml1135 e6f4e6d
State the compounding rejection contract of TraceManagerExtensions in…
johnml1135 9bcdcd5
Document that PartialParseFailure.Rule is null when the next rule is …
johnml1135 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
67 changes: 67 additions & 0 deletions
67
src/SIL.Machine.Morphology.HermitCrab/IDetailedTraceManager.cs
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| namespace SIL.Machine.Morphology.HermitCrab | ||
| { | ||
| public enum TemplateSlotOutcome | ||
| { | ||
| RuleApplied, | ||
| OptionalSkipped, | ||
| RequiredUnfilled, | ||
| } | ||
|
|
||
| public enum PartialParseCause | ||
| { | ||
| RealizationalFeatureMismatch, | ||
| UnappliedMorphologicalRules, | ||
| NonFinalTemplateAppliedLast, | ||
| ApplicableTemplatesNotApplied, | ||
| } | ||
|
|
||
| public class PartialParseFailure | ||
| { | ||
| public PartialParseFailure(PartialParseCause cause, IMorphologicalRule rule = null) | ||
| { | ||
| Cause = cause; | ||
| Rule = rule; | ||
| } | ||
|
|
||
| public PartialParseCause Cause { get; } | ||
|
|
||
| /// <summary> | ||
| /// The next rule that was not applied, or null when it is unknown. It is also null when the next | ||
| /// step is a compounding non-head, whose rule is not recorded. | ||
| /// </summary> | ||
| public IMorphologicalRule Rule { get; } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Optional tracing capability. ITraceManager implementations receive the existing callbacks without opting in. | ||
| /// </summary> | ||
| public interface IDetailedTraceManager : ITraceManager | ||
| { | ||
| void MorphologicalRuleNotUnapplied( | ||
| IMorphologicalRule rule, | ||
| int subruleIndex, | ||
| Word input, | ||
| FailureReason reason, | ||
| object failureObj | ||
| ); | ||
|
|
||
| /// <summary> | ||
| /// Reports fully enumerated lookup results as yielded Word candidates, before surface validation. | ||
| /// Interrupted lookups do not receive this callback. Each input has at most one active lookup. | ||
| /// </summary> | ||
| void LexicalLookupCompleted(Stratum stratum, Word input, int candidateCount, bool guessed); | ||
|
|
||
| /// <summary> | ||
| /// Reports a slot branch. OptionalSkipped can accompany RuleApplied for the same input. | ||
| /// RequiredUnfilled means the slot produced no output; no linguistic cause is implied. | ||
| /// </summary> | ||
| void TemplateSlotProcessed( | ||
| AffixTemplate template, | ||
| int slotIndex, | ||
| Word input, | ||
| Word output, | ||
| bool analysis, | ||
| TemplateSlotOutcome outcome | ||
| ); | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.