Skip to content

Commit

Permalink
Fix formatting errors and placement of Guessed
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaxwell3 committed Sep 13, 2024
1 parent 07c1247 commit 0282695
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/SIL.Machine.Morphology.HermitCrab/Allomorph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public IDictionary<string, object> Properties
get { return _properties; }
}

/// <summary>
/// Was this allomorph guessed by a lexical pattern?
/// </summary>
public bool Guessed { get; set; }

public bool FreeFluctuatesWith(Allomorph other)
{
if (this == other)
Expand Down
4 changes: 3 additions & 1 deletion src/SIL.Machine.Morphology.HermitCrab/Morpher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ private IEnumerable<Word> LexicalGuess(Word input)
IEnumerable<ShapeNode> shapeNodes = input.Shape.GetNodes(input.Range);
foreach (RootAllomorph lexicalPattern in _lexicalPatterns)
{
IEnumerable<ShapeNode> shapePattern = lexicalPattern.Segments.Shape.GetNodes(lexicalPattern.Segments.Shape.Range);
IEnumerable<ShapeNode> shapePattern = lexicalPattern.Segments.Shape.GetNodes(
lexicalPattern.Segments.Shape.Range
);
foreach (List<ShapeNode> match in MatchNodesWithPattern(shapeNodes.ToList(), shapePattern.ToList()))
{
// Create a root allomorph for the guess.
Expand Down
5 changes: 0 additions & 5 deletions src/SIL.Machine.Morphology.HermitCrab/RootAllomorph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public Segments Segments
/// </summary>
public bool IsPattern { get; set; }

/// <summary>
/// Was this allomorph guessed by a lexical pattern?
/// </summary>
public bool Guessed { get; set; }

protected override bool ConstraintsEqual(Allomorph other)
{
if (!(other is RootAllomorph otherAllo))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void AnalyzeWord_CanGuess_ReturnsCorrectAnalysis()
node.Annotation.Iterative = true;
var shape = new Shape(begin => new ShapeNode(
begin ? HCFeatureSystem.LeftSideAnchor : HCFeatureSystem.RightSideAnchor
));
));
shape.AddRange(new List<ShapeNode> { node });
var lexicalPattern = new RootAllomorph(new Segments(Table1, "", shape));

Expand Down

0 comments on commit 0282695

Please sign in to comment.