ow
This commit is contained in:
1 parent
91feed7cbb
commit
8c8ab4ff5f
3 files changed
+17
-6
No files matched your search
@@ -32,6 +32,8 @@ namespace CloudBuilder.Topshelf.Task
|
||||
|
||||
IRepository<AiSentenceEntity> repositoryAiSentenceEntity = service.GetRepository<IRepository<AiSentenceEntity>>();
|
||||
|
||||
IRepository<AiChapterPersonEntity> repositoryAiChapterPersonEntity = service.GetRepository<IRepository<AiChapterPersonEntity>>();
|
||||
|
||||
string depRoot;
|
||||
|
||||
List<NamedEntity> ners;
|
||||
@@ -51,7 +53,7 @@ namespace CloudBuilder.Topshelf.Task
|
||||
|
||||
int totalLines = ents.Length;
|
||||
int processedLines = 0; // 已处理行数计数器
|
||||
|
||||
AiChapterPersonEntity aiChapterPerson;
|
||||
foreach (var ent in ents)
|
||||
{
|
||||
processedLines++;
|
||||
@@ -61,10 +63,19 @@ namespace CloudBuilder.Topshelf.Task
|
||||
|
||||
if (!string.IsNullOrEmpty(person))
|
||||
{
|
||||
aiSentenceEntity = repositoryAiSentenceEntity.Entities.Where(x => x.SentenceId == ent.SentenceId).FirstOrDefault();
|
||||
aiSentenceEntity.PersonName = person;
|
||||
string[] ps = person.Split(',');
|
||||
int orderIndex = 1;
|
||||
foreach (var p in ps)
|
||||
{
|
||||
if (p.Length == 1) continue;
|
||||
aiChapterPerson = new AiChapterPersonEntity();
|
||||
aiChapterPerson.PersonName = p;
|
||||
aiChapterPerson.ChapterId = ent.ChapterId;
|
||||
aiChapterPerson.ParagraphIndex = ent.ParagraphId;
|
||||
aiChapterPerson.OrderIndex = orderIndex++;
|
||||
|
||||
repositoryAiSentenceEntity.UpdateNow(aiSentenceEntity);
|
||||
repositoryAiChapterPersonEntity.InsertNow(aiChapterPerson);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateProgress(processedLines, totalLines);
|
||||
|
||||
Reference in new issue
Block a user