Skip to content

Commit

Permalink
Join requested lines and document lines together
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jul 7, 2015
1 parent 1d01121 commit 2612888
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ public async Task<HighlightResponse> Highlight(HighlightRequest request)
}
else
{
foreach (var line in request.Lines.Where(z => z <= text.Lines.Count))
var linesToClassify = request.Lines.Join(
text.Lines,
line => line,
line => line.LineNumber,
(requestLine, line) => line.Span);
foreach (var lineSpan in linesToClassify)
{
foreach (var span in await Classifier.GetClassifiedSpansAsync(document, text.Lines[line - 1].Span))
foreach (var span in await Classifier.GetClassifiedSpansAsync(document, lineSpan))
{
spans.Add(span);
}
Expand Down

0 comments on commit 2612888

Please sign in to comment.