Rename TocDetection to DetectToc

This commit is contained in:
Johannes Zillmann 2021-04-18 15:31:45 +02:00
parent 6ad8d2daa9
commit 5b611cd506
25 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import CalculateStatistics from './transformer/CacluclateStatistics';
import CompactLines from './transformer/CompactLines';
import SortXWithinLines from './transformer/SortXWithinLines';
import RemoveRepetitiveItems from './transformer/RemoveRepetitiveItems';
import TocDetection from './transformer/TocDetection';
import DetectToc from './transformer/DetectToc';
import NoOpTransformer from './transformer/NoOpTransformer';
export const transformers = [
@ -22,7 +22,7 @@ export const transformers = [
new CompactLines(),
new SortXWithinLines(),
new RemoveRepetitiveItems(),
new TocDetection(),
new DetectToc(),
new NoOpTransformer(),
];

View File

@ -14,10 +14,10 @@ const config = {
linkMinLength: 5,
};
export default class TocDetection extends ItemTransformer {
export default class DetectToc extends ItemTransformer {
constructor() {
super(
'TOC Detection',
'Detect TOC',
'Detect table of contents.',
{
requireColumns: ['x', 'y', 'str', 'line'],

View File

@ -15,7 +15,7 @@ import RemoveRepetitiveItems from 'src/transformer/RemoveRepetitiveItems';
import StageResult from 'src/debug/StageResult';
import EvaluationIndex from 'src/debug/EvaluationIndex';
import { Change } from 'src/debug/ChangeIndex';
import TocDetection from 'src/transformer/TocDetection';
import DetectToc from 'src/transformer/DetectToc';
const parser = new PdfParser(pdfjs);
const pipeline = new PdfPipeline(parser, transformers);
@ -85,7 +85,7 @@ function matchFilePath(pdfFileName: string, transformerName: string, chunkCount
}
describe('Selective transforms on URL PDFs', () => {
const transformerNames = [new RemoveRepetitiveItems().name, new TocDetection().name];
const transformerNames = [new RemoveRepetitiveItems().name, new DetectToc().name];
test.each(urls)('URL %p', async (url) => {
const { fileName, data } = download(url);
const debug = await pipeline.debug(data, () => {});