Skip to content

Commit

Permalink
Make inline with understood reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Jun 19, 2024
1 parent d94a768 commit 55fad88
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/SIL.Machine/Corpora/IUsfmParserHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IUsfmParserHandler
/// End of a book element, not the end of the entire book.
/// Book element contains the description as text
/// </summary>
void EndBook(UsfmParserState state);
void EndBook(UsfmParserState state, string marker);

/// <summary>
/// Chapter element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ protected ScriptureRefUsfmParserHandlerBase()
public override void EndUsfm(UsfmParserState state)
{
EndVerseText(state);
EndBook(state);
}

public override void Chapter(
Expand Down
2 changes: 1 addition & 1 deletion src/SIL.Machine/Corpora/UsfmParserHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public virtual void GotMarker(UsfmParserState state, string marker) { }

public virtual void StartBook(UsfmParserState state, string marker, string code) { }

public virtual void EndBook(UsfmParserState state) { }
public virtual void EndBook(UsfmParserState state, string marker) { }

public virtual void Chapter(
UsfmParserState state,
Expand Down
6 changes: 3 additions & 3 deletions src/SIL.Machine/Corpora/UsfmTextUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public UsfmTextUpdater(
public override void EndUsfm(UsfmParserState state)
{
CollectTokens(state);
InsertRemainingRows();
base.EndUsfm(state);
}

Expand All @@ -55,12 +56,11 @@ public override void StartBook(UsfmParserState state, string marker, string code
base.StartBook(state, marker, code);
}

public override void EndBook(UsfmParserState state)
public override void EndBook(UsfmParserState state, string marker)
{
PopNewTokens();

InsertRemainingRows();
base.EndBook(state);
base.EndBook(state, marker);
}

public override void StartPara(
Expand Down
2 changes: 1 addition & 1 deletion tests/SIL.Machine.Tests/Corpora/UsfmTokenizerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void Tokenize()
string usfm = ReadUsfm();
var tokenizer = new UsfmTokenizer();
IReadOnlyList<UsfmToken> tokens = tokenizer.Tokenize(usfm);
Assert.That(tokens, Has.Count.EqualTo(238));
Assert.That(tokens, Has.Count.EqualTo(239));

Assert.That(tokens[0].Type, Is.EqualTo(UsfmTokenType.Book));
Assert.That(tokens[0].Marker, Is.EqualTo("id"));
Expand Down

0 comments on commit 55fad88

Please sign in to comment.