Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
miyaji255 committed Apr 4, 2024
1 parent 2f3069a commit c82b434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions Epub/KoeBook.Epub/Services/AnalyzerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class AnalyzerService(IScraperSelectorService scrapingService, IE
private Dictionary<string, string> _rubyReplacements = new Dictionary<string, string>();

public async ValueTask<BookScripts> AnalyzeAsync(BookProperties bookProperties, string tempDirectory, CancellationToken cancellationToken)
{
{
Directory.CreateDirectory(tempDirectory);
var coverFilePath = Path.Combine(tempDirectory, "Cover.png");
using var fs = File.Create(coverFilePath);
Expand Down Expand Up @@ -53,12 +53,7 @@ public async ValueTask<BookScripts> AnalyzeAsync(BookProperties bookProperties,
var rubyDict = ExtractRuby(line).ToDictionary();

Check warning on line 53 in Epub/KoeBook.Epub/Services/AnalyzerService.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'text' in 'IEnumerable<KeyValuePair<string, string>> AnalyzerService.ExtractRuby(string text)'.

Check warning on line 53 in Epub/KoeBook.Epub/Services/AnalyzerService.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'text' in 'IEnumerable<KeyValuePair<string, string>> AnalyzerService.ExtractRuby(string text)'.

Check warning on line 53 in Epub/KoeBook.Epub/Services/AnalyzerService.cs

View workflow job for this annotation

GitHub Actions / test

Possible null reference argument for parameter 'text' in 'IEnumerable<KeyValuePair<string, string>> AnalyzerService.ExtractRuby(string text)'.

foreach (var ruby in rubyDict)
{
if (!_rubyReplacements.ContainsKey(ruby.Key))
{
_rubyReplacements.Add(ruby.Key, ruby.Value);
}
}
_rubyReplacements.TryAdd(ruby.Key, ruby.Value);
// ルビを置換
line = ReplaceBaseTextWithRuby(line, rubyDict);

Expand Down
2 changes: 1 addition & 1 deletion KoeBook.Core/Contracts/Services/IAnalyzerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IAnalyzerService
/// 本の情報の取得・解析を行います
/// </summary>
/// <returns>編集前の読み上げテキスト</returns>
ValueTask<BookScripts> AnalyzeAsync(BookProperties bookProperties, string tempDirectory, CancellationToken cancellationToken);
ValueTask<BookScripts> AnalyzeAsync(BookProperties bookProperties, string tempDirectory, CancellationToken cancellationToken);
}

0 comments on commit c82b434

Please sign in to comment.