From d3b619b6ee5cd1f1e55feb4a173307fb3216e11e Mon Sep 17 00:00:00 2001 From: BobLd Date: Tue, 29 Sep 2020 13:50:05 +0100 Subject: [PATCH] Fix Error CS0136 and tidy up code --- .../UnsupervisedReadingOrderDetector.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/UglyToad.PdfPig.DocumentLayoutAnalysis/ReadingOrderDetector/UnsupervisedReadingOrderDetector.cs b/src/UglyToad.PdfPig.DocumentLayoutAnalysis/ReadingOrderDetector/UnsupervisedReadingOrderDetector.cs index 8fd1c736..dd4bcbcc 100644 --- a/src/UglyToad.PdfPig.DocumentLayoutAnalysis/ReadingOrderDetector/UnsupervisedReadingOrderDetector.cs +++ b/src/UglyToad.PdfPig.DocumentLayoutAnalysis/ReadingOrderDetector/UnsupervisedReadingOrderDetector.cs @@ -6,7 +6,8 @@ /// /// Algorithm that retrieve the blocks' reading order using spatial reasoning (Allen’s interval relations) and possibly the rendering order (TextSequence). - /// See section 4.1 of 'Unsupervised document structure analysis of digital scientific articles' by S. Klampfl, M. Granitzer, K. Jack, R. Kern and 'Document Understanding for a Broad Class of Documents' by L. Todoran, M. Worring, M. Aiello and C. Monz. + /// See section 4.1 of 'Unsupervised document structure analysis of digital scientific articles' by S. Klampfl, M. Granitzer, K. Jack, R. Kern + /// and 'Document Understanding for a Broad Class of Documents' by L. Todoran, M. Worring, M. Aiello and C. Monz. /// public class UnsupervisedReadingOrderDetector : IReadingOrderDetector { @@ -79,7 +80,7 @@ case SpatialReasoningRules.ColumnWise: if (UseRenderingOrder) { - getBeforeInMethod = (TextBlock a, TextBlock b, double T) => GetBeforeInReadingVertical(a, b, T) || GetBeforeInRendering(a, b); + getBeforeInMethod = (TextBlock a, TextBlock b, double t) => GetBeforeInReadingVertical(a, b, t) || GetBeforeInRendering(a, b); } else { @@ -90,7 +91,7 @@ case SpatialReasoningRules.RowWise: if (UseRenderingOrder) { - getBeforeInMethod = (TextBlock a, TextBlock b, double T) => GetBeforeInReadingHorizontal(a, b, T) || GetBeforeInRendering(a, b); + getBeforeInMethod = (TextBlock a, TextBlock b, double t) => GetBeforeInReadingHorizontal(a, b, t) || GetBeforeInRendering(a, b); } else { @@ -102,7 +103,7 @@ default: if (UseRenderingOrder) { - getBeforeInMethod = (TextBlock a, TextBlock b, double T) => GetBeforeInReading(a, b, T) || GetBeforeInRendering(a, b); + getBeforeInMethod = (TextBlock a, TextBlock b, double t) => GetBeforeInReading(a, b, t) || GetBeforeInRendering(a, b); } else { @@ -162,7 +163,6 @@ if (i == j) continue; var b = textBlocks[j]; - //if (GetBeforeInReadingRendering(a, b, T)) if (getBeforeInMethod(a, b, T)) { graph[i].Add(j); @@ -517,13 +517,5 @@ /// Equals } - - private class NodeComparer : IComparer>> - { - public int Compare(KeyValuePair> x, KeyValuePair> y) - { - return x.Value.Count.CompareTo(y.Value.Count); - } - } } }