Skip to content

Commit

Permalink
Remove constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Aug 1, 2024
1 parent 6920a0d commit 1af0e3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
17 changes: 7 additions & 10 deletions src/SIL.Machine/Corpora/ParatextProjectTextUpdaterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ namespace SIL.Machine.Corpora
{
public abstract class ParatextProjectTextUpdaterBase
{
private readonly ParatextProjectSettings _settings;
private readonly ParatextProjectSettingsParserBase _settingsParser;

protected ParatextProjectTextUpdaterBase(ParatextProjectSettingsParserBase settingsParser)
{
_settings = settingsParser.Parse();
}

protected ParatextProjectTextUpdaterBase(ParatextProjectSettings settings)
{
_settings = settings;
_settingsParser = settingsParser;
}

public string UpdateUsfm(
Expand All @@ -25,7 +20,9 @@ public string UpdateUsfm(
bool preferExistingText = true
)
{
string fileName = _settings.GetBookFileName(bookId);
ParatextProjectSettings settings = _settingsParser.Parse();

string fileName = settings.GetBookFileName(bookId);
if (!Exists(fileName))
return null;

Expand All @@ -41,8 +38,8 @@ public string UpdateUsfm(
stripAllText,
preferExistingText: preferExistingText
);
UsfmParser.Parse(usfm, handler, _settings.Stylesheet, _settings.Versification);
return handler.GetUsfm(_settings.Stylesheet);
UsfmParser.Parse(usfm, handler, settings.Stylesheet, settings.Versification);
return handler.GetUsfm(settings.Stylesheet);
}

protected abstract bool Exists(string fileName);
Expand Down
3 changes: 0 additions & 3 deletions src/SIL.Machine/Corpora/ZipParatextProjectTextUpdaterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ public abstract class ZipParatextProjectTextUpdaterBase : ParatextProjectTextUpd
{
protected ZipParatextProjectTextUpdaterBase(ZipParatextProjectSettingsParserBase settingsParser)
: base(settingsParser) { }

protected ZipParatextProjectTextUpdaterBase(ParatextProjectSettings settings)
: base(settings) { }
}
}

0 comments on commit 1af0e3c

Please sign in to comment.