From 9e5ea602bcd42400108619e86e032c5b4d97fbdf Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 30 Sep 2024 10:22:47 -0700 Subject: [PATCH] Replace Iterative with IsIterative and SetIterative --- .../CharacterDefinitionTable.cs | 2 +- .../HermitCrabExtensions.cs | 13 +++++++++++++ src/SIL.Machine.Morphology.HermitCrab/Morpher.cs | 2 +- .../RootAllomorph.cs | 2 +- src/SIL.Machine/Annotations/ShapeNode.cs | 15 --------------- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/SIL.Machine.Morphology.HermitCrab/CharacterDefinitionTable.cs b/src/SIL.Machine.Morphology.HermitCrab/CharacterDefinitionTable.cs index 5905d3a86..2854481e2 100644 --- a/src/SIL.Machine.Morphology.HermitCrab/CharacterDefinitionTable.cs +++ b/src/SIL.Machine.Morphology.HermitCrab/CharacterDefinitionTable.cs @@ -189,7 +189,7 @@ private bool GetShapeNodes(string str, bool allowPattern, out IEnumerable NodeComparer = new ProjectionEqualityComparer< ShapeNode, FeatureStruct diff --git a/src/SIL.Machine.Morphology.HermitCrab/Morpher.cs b/src/SIL.Machine.Morphology.HermitCrab/Morpher.cs index d996d9fe8..c6c58a919 100644 --- a/src/SIL.Machine.Morphology.HermitCrab/Morpher.cs +++ b/src/SIL.Machine.Morphology.HermitCrab/Morpher.cs @@ -466,7 +466,7 @@ public IEnumerable> MatchNodesWithPattern( return results; // Make a copy of prefix to avoid crosstalk and add newNode. prefix = new List(prefix) { newNode }; - if (pattern[p].Iterative) + if (pattern[p].IsIterative()) // Try using this item in the pattern again. results.AddRange(MatchNodesWithPattern(nodes, pattern, n + 1, p, true, prefix)); // Try the remainder of the nodes against the remainder of the pattern. diff --git a/src/SIL.Machine.Morphology.HermitCrab/RootAllomorph.cs b/src/SIL.Machine.Morphology.HermitCrab/RootAllomorph.cs index 464475f66..da8de03ba 100644 --- a/src/SIL.Machine.Morphology.HermitCrab/RootAllomorph.cs +++ b/src/SIL.Machine.Morphology.HermitCrab/RootAllomorph.cs @@ -18,7 +18,7 @@ public RootAllomorph(Segments segments) _segments = segments; foreach (ShapeNode node in _segments.Shape.GetNodes(_segments.Shape.Range)) { - if (node.Iterative || (node.Annotation.Optional && node.Annotation.Type() != HCFeatureSystem.Boundary)) + if (node.IsIterative() || (node.Annotation.Optional && node.Annotation.Type() != HCFeatureSystem.Boundary)) { IsPattern = true; } diff --git a/src/SIL.Machine/Annotations/ShapeNode.cs b/src/SIL.Machine/Annotations/ShapeNode.cs index 29a9d5064..cf72e7c8f 100644 --- a/src/SIL.Machine/Annotations/ShapeNode.cs +++ b/src/SIL.Machine/Annotations/ShapeNode.cs @@ -45,21 +45,6 @@ public Annotation Annotation get { return _ann; } } - /// - /// Whether this is an iterative node in a lexical pattern. - /// - public bool Iterative - { - get { return Annotation.Data != null; } - set - { - if (value) - Annotation.Data = value; - else - Annotation.Data = null; - } - } - public int CompareTo(ShapeNode other) { if (other.List != List)