This commit is contained in:
owenchen committed 2026-06-04 16:02:14 +08:00
1 parent 4ea68c801f
commit dbfa9bd1e8
8 files changed
+70 -34

No files matched your search

+11 -6
View File
@@ -68,12 +68,15 @@ namespace CloudBuilder.Topshelf.Utility
{
HanlpConstituencyNode[] nodesSon;
nodef = HanlpResultHelper.GetNodeById(cons, node.ItemId + 1);
if (nps.Contains(nodef.Label))
if (nodef != null)
{
nodesSon = HanlpResultHelper.GetNodeSonById(cons, nodef.ItemId);
if (nodesSon != null && nodesSon.Where(x => x.Children == 0).Any())
if (nps.Contains(nodef.Label))
{
feature += string.Concat(nodesSon.Select(x => x.Label));
nodesSon = HanlpResultHelper.GetNodeSonById(cons, nodef.ItemId);
if (nodesSon != null && nodesSon.Where(x => x.Children == 0).Any())
{
feature += string.Concat(nodesSon.Select(x => x.Label));
}
}
}
}
@@ -152,7 +155,7 @@ namespace CloudBuilder.Topshelf.Utility
}
}
}
/*暂不处理arg1
foreach (var mrp in srl)
{
if (mrp.Type.ToUpper() != "ARG0") continue;
@@ -170,6 +173,7 @@ namespace CloudBuilder.Topshelf.Utility
arg1 = mrp.Text;
}
}
*/
}
}
@@ -208,7 +212,8 @@ namespace CloudBuilder.Topshelf.Utility
if (aiSentenceView.PersonName.Contains("【"))
{
aiSentenceView.PersonName = AiChapterPersons.Where(x => !x.PersonName.Contains("【") && x.PersonName.Contains(aiSentenceView.PersonName.Replace("【", "").Replace("】", ""))).FirstOrDefault()!.PersonName;
if (AiChapterPersons.Where(x => !x.PersonName.Contains("【") && x.PersonName.Contains(aiSentenceView.PersonName.Replace("【", "").Replace("】", ""))).Any())
aiSentenceView.PersonName = AiChapterPersons.Where(x => !x.PersonName.Contains("【") && x.PersonName.Contains(aiSentenceView.PersonName.Replace("【", "").Replace("】", ""))).FirstOrDefault()!.PersonName;
}
}
//说话者在前面