ow
This commit is contained in:
parent
91feed7cbb
commit
8c8ab4ff5f
@ -2,7 +2,7 @@
|
||||
"profiles": {
|
||||
"CloudBuilder.Topshelf": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "task:PythonRunTask book_id:B000008"
|
||||
"commandLineArgs": "task:ChineseNameExtractorTask book_id:B000008"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -103,7 +103,7 @@ namespace CloudBuilder.Topshelf.Utility
|
||||
}
|
||||
|
||||
//如果主语==动作发出者
|
||||
if (!string.IsNullOrEmpty(person) && !ps.Contains(person) && !ps.Contains(string.Format("[{0}]", person))) ps.Add(string.Format("[{0}]", person));
|
||||
//if (!string.IsNullOrEmpty(person) && !ps.Contains(person) && !ps.Contains(string.Format("[{0}]", person))) ps.Add(string.Format("[{0}]", person));
|
||||
//动作接受者
|
||||
//if (!string.IsNullOrEmpty(arg1) && !ps.Contains(arg1)) ps.Add(arg1);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user