mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 02:37:56 +08:00
Fix Error CS0136 and tidy up code
This commit is contained in:
@@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Algorithm that retrieve the blocks' reading order using spatial reasoning (Allen’s interval relations) and possibly the rendering order (TextSequence).
|
/// Algorithm that retrieve the blocks' reading order using spatial reasoning (Allen’s interval relations) and possibly the rendering order (TextSequence).
|
||||||
/// <para>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.</para>
|
/// <para>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.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UnsupervisedReadingOrderDetector : IReadingOrderDetector
|
public class UnsupervisedReadingOrderDetector : IReadingOrderDetector
|
||||||
{
|
{
|
||||||
@@ -79,7 +80,7 @@
|
|||||||
case SpatialReasoningRules.ColumnWise:
|
case SpatialReasoningRules.ColumnWise:
|
||||||
if (UseRenderingOrder)
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
case SpatialReasoningRules.RowWise:
|
case SpatialReasoningRules.RowWise:
|
||||||
if (UseRenderingOrder)
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -102,7 +103,7 @@
|
|||||||
default:
|
default:
|
||||||
if (UseRenderingOrder)
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -162,7 +163,6 @@
|
|||||||
if (i == j) continue;
|
if (i == j) continue;
|
||||||
var b = textBlocks[j];
|
var b = textBlocks[j];
|
||||||
|
|
||||||
//if (GetBeforeInReadingRendering(a, b, T))
|
|
||||||
if (getBeforeInMethod(a, b, T))
|
if (getBeforeInMethod(a, b, T))
|
||||||
{
|
{
|
||||||
graph[i].Add(j);
|
graph[i].Add(j);
|
||||||
@@ -517,13 +517,5 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Equals
|
Equals
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NodeComparer : IComparer<KeyValuePair<int, List<int>>>
|
|
||||||
{
|
|
||||||
public int Compare(KeyValuePair<int, List<int>> x, KeyValuePair<int, List<int>> y)
|
|
||||||
{
|
|
||||||
return x.Value.Count.CompareTo(y.Value.Count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user