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
19 changes: 10 additions & 9 deletions Src/LexText/Interlinear/BIRDInterlinearImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,6 @@ private static void AddWordToSegment(ISegment newSegment, Word word)
//use the items under the word to determine what kind of thing to add to the segment
var cache = newSegment.Cache;
IAnalysis analysis = CreateWordAnalysisStack(cache, word);
if (analysis != null && word.morphemes?.analysisStatus == analysisStatusTypes.guess)
{
// Ignore morphological analysis if it was only a guess.
analysis = analysis.Wordform;
}

// Add to segment
if (analysis != null)
{
Expand Down Expand Up @@ -941,19 +935,26 @@ private static void UpgradeToWordGloss(Word word, ref IAnalysis analysis)
// else, reuse the same analysisTree for setting a gloss alternative

analysisTree.Gloss.Form.set_String(wsNewGloss, wordGlossItem.Value);
// Make sure this analysis is marked as user-approved (green check mark)
cache.LangProject.DefaultUserAgent.SetEvaluation(analysisTree.WfiAnalysis, Opinions.approves);
if (word.morphemes?.analysisStatus != analysisStatusTypes.guess)
{
// Make sure this analysis is marked as user-approved (green check mark)
cache.LangProject.DefaultUserAgent.SetEvaluation(analysisTree.WfiAnalysis, Opinions.approves);
}
// Create a morpheme form that matches the wordform.
var morphemeBundle = cache.ServiceLocator.GetInstance<IWfiMorphBundleFactory>().Create();
var wordItem = word.Items.Select(i => i).First(i => i.type == "txt");
int wsWord = GetWsEngine(wsFact, wordItem.lang).Handle;
analysisTree.WfiAnalysis.MorphBundlesOS.Add(morphemeBundle);
morphemeBundle.Form.set_String(wsWord, wordItem.Value);

analysis = analysisTree.Gloss;
}
}
}
if (analysis != null && word.morphemes?.analysisStatus == analysisStatusTypes.guess)
{
// Ignore gloss if morphological analysis was only a guess.
analysis = analysis.Wordform;
}
}

/// <summary>
Expand Down
Loading