Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 18 additions & 6 deletions Src/LexText/ParserCore/XAmplePropertiesXAmpleDataFilesAugmenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void AddXAmplePropertiesToLexiconFile()
list.Name.BestAnalysisAlternative.Text
== customListName
);
BuildAllomorphPropertyMapper(allomorphHvoPropertyMapper, customList);
BuildAllomorphPropertyMapper(allomorphHvoPropertyMapper, customList, customListName);
BuildMorphemePropertyMapper(morphemePropertyMapper, customList);
// Add allomorph properties
var lexWithAlloProps = allomorphHvoPropertyMapper.Aggregate(
Expand Down Expand Up @@ -178,25 +178,37 @@ private void CreateXAmpleTempFileAndCopyBack(string xAmpleFile, string tempExten

private static void BuildAllomorphPropertyMapper(
Dictionary<string, string> allomorphHvoPropertyMapper,
ICmPossibilityList customList)
ICmPossibilityList customList, string customListName)
{
foreach (var prop in customList.PossibilitiesOS)
{
var refObjs = prop.ReferringObjects.Select(o => o).Where(o => !(o is ILexEntry));
foreach (ICmObject obj in refObjs)
{
var sHvo = obj.Hvo.ToString();
if (!allomorphHvoPropertyMapper.ContainsKey(sHvo))
var hvoMatch = " {" + sHvo + "}";
if (!allomorphHvoPropertyMapper.ContainsKey(hvoMatch))
{
var hvoMatch = " {" + sHvo + "}";
var replaceWith =
hvoMatch + " " + prop.Name.AnalysisDefaultWritingSystem.Text;
var replaceWith = hvoMatch + " " + prop.Name.AnalysisDefaultWritingSystem.Text;
allomorphHvoPropertyMapper.Add(hvoMatch, replaceWith);
} else
{
// Append the new value to the existing value.
allomorphHvoPropertyMapper[hvoMatch] += " " + prop.Name.AnalysisDefaultWritingSystem.Text;
}
}
}
}

private static string LexEntryName(ICmObject obj)
{
if (obj.ClassName == "MoAffixAllomorph")
{
return ((IMoAffixAllomorph)obj).LongName;
}
return "***";
}

private static void BuildMorphemePropertyMapper(
Dictionary<string, string> morphemePropertyMapper,
ICmPossibilityList customList
Expand Down
2 changes: 2 additions & 0 deletions Src/LexText/ParserUI/ParserConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public void ParserUpdateHandlerForPolling(object sender, ParserUpdateEventArgs a
{
//store this for clients which just want to poll us, instead of wiring up to the event
m_activity = args.Task.Description;
if (args.Task.Phase == TaskReport.TaskPhase.Finished)
m_activity = "";
//keeps us from getting the notification at the end of the task.
if (args.Task.NotificationMessage != null && args.Task.Phase != TaskReport.TaskPhase.Finished)
m_notificationMessage = args.Task.NotificationMessage;
Expand Down
Loading