Skip to content

Commit

Permalink
#54 Claudeが生成するプロンプトへの対処を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
aiueo-1234 committed May 3, 2024
1 parent 749863e commit 04f04ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions KoeBook.Core/Services/ClaudeAnalyzerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,15 @@ private static (Character[], Dictionary<string, string>) ExtractCharacterList(st
var voiceIdLine = zippedLine.First.AsSpan();
voiceIdLine = voiceIdLine[(voiceIdLine.IndexOf(' ') + 2)..];//cまで無視
voiceIdLine = voiceIdLine[..voiceIdLine.IndexOf(' ')];// 二人以上話す時には先頭のものを使う
if (voiceIdLine[^1] == '.')// idに"."がつくことがあるので削除する
{
voiceIdLine = voiceIdLine[..^1];
}
if (characterId2Name.TryGetValue(voiceIdLine.ToString(), out var characterName))
{
zippedLine.Second.Character = characterName;
}
else { throw new EbookException(ExceptionType.ClaudeTalkerAndStyleSettingFailed); }
return 0;
}).Count();
if (voiceIdLinesCount != scriptLines.Length)
Expand Down

0 comments on commit 04f04ec

Please sign in to comment.