mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2024-11-23 00:03:39 +01:00
Rename TocDetection to DetectToc
This commit is contained in:
parent
6ad8d2daa9
commit
5b611cd506
@ -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(),
|
||||
];
|
||||
|
||||
|
@ -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'],
|
@ -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, () => {});
|
||||
|
Loading…
Reference in New Issue
Block a user