Skip to content

Commit

Permalink
Move check to text generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Aug 26, 2024
1 parent 7f02609 commit 0d743a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public override void EndNote(UsfmParserState state, string marker, bool closed)
public override void Text(UsfmParserState state, string text)
{
// if we hit text in a verse paragraph and we aren't in a verse, then start a non-verse segment
if (text.Trim().Length > 0 && text.Trim() != "...")
if (text.Trim().Length > 0)
CheckConvertVerseParaToNonVerse(state);
}

Expand Down
9 changes: 4 additions & 5 deletions src/SIL.Machine/Corpora/UsfmTextBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,6 @@ public override void Text(UsfmParserState state, string text)
if (_rowTexts.Count == 0)
return;

if (text.Trim() == "...")
{
text = "";
}

StringBuilder rowText = _rowTexts.Peek();
if (_text._includeMarkers)
{
Expand Down Expand Up @@ -279,6 +274,10 @@ protected override void StartVerseText(UsfmParserState state, IReadOnlyList<Scri
protected override void EndVerseText(UsfmParserState state, IReadOnlyList<ScriptureRef> scriptureRefs)
{
string text = _rowTexts.Pop().ToString();
if (text.Trim() == "...")
{
text = "";
}
_rows.AddRange(_text.CreateRows(scriptureRefs, text, _sentenceStart));
_sentenceStart = state.Token.Marker == "c" || text.HasSentenceEnding();
}
Expand Down

0 comments on commit 0d743a7

Please sign in to comment.