Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/SIL.Machine.Morphology.HermitCrab/Word.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ internal IList<Word> ExpandAlternatives()
{
IList<Word> alternatives = new List<Word>();
IList<Word> originals = Source?.ExpandAlternatives();
// Update the alternatives of CloneOf with any changes made since the clone.
// Update the alternatives of Source with any changes made since Source.
if (originals == null || originals.Count < 2)
{
// Special case.
Expand All @@ -429,7 +429,16 @@ internal IList<Word> ExpandAlternatives()
int nh_start = Source == null ? 0 : Source._nonHeadApps.Count();
for (int i = nh_start; i < _nonHeadApps.Count(); i++)
alternative.NonHeadUnapplied(_nonHeadApps[i]);
if (RootAllomorph != null)
// Add changes to feature structures to alternative.
if (!_realizationalFS.ValueEquals(Source._realizationalFS))
{
FeatureStruct diff = _realizationalFS.Clone();
diff.Subtract(Source._realizationalFS);
FeatureStruct newFS;
alternative._realizationalFS.Unify(diff, out newFS);
alternative._realizationalFS = newFS;
}
if (RootAllomorph != Source.RootAllomorph)
alternative.RootAllomorph = RootAllomorph;
alternative.Freeze();
alternatives.Add(alternative);
Expand Down
Loading