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
15 changes: 14 additions & 1 deletion Src/LexText/ParserCore/FwXmlTraceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,12 @@ private static XElement CreateWordElement(string name, Word word, bool analysis,

private static string ToBracketedString(IEnumerable<ShapeNode> nodes, CharacterDefinitionTable table)
{
// This should be in defined as Shape.ToBracketedString in HermitCrab.
StringBuilder stringBuilder = new StringBuilder();
foreach (ShapeNode node in nodes)
{
string text = table.GetMatchingStrReps(node).FirstOrDefault();
if (text != null)
if (text != null && !IsDeleted(node))
{
if (text.Length > 1)
text = "(" + text + ")";
Expand All @@ -422,6 +423,18 @@ private static string ToBracketedString(IEnumerable<ShapeNode> nodes, CharacterD
return stringBuilder.ToString();
}

private static bool IsDeleted(ShapeNode node)
{
// ShapeNode.IsDeleted is copied here since it is inaccessible from FieldWorks.
Annotation<ShapeNode> ann = node.Annotation;
if (ann.FeatureStruct.TryGetValue<SymbolicFeatureValue>(HCFeatureSystem.Deletion, out var value))
{
return (FeatureSymbol)value == HCFeatureSystem.Deleted;
}

return false;
}

private XElement CreateMorphemeElement(Morpheme morpheme)
{
var msaID = (int?) morpheme.Properties[HCParser.MsaID] ?? 0;
Expand Down
Loading