@heripo/pdf-parser 0.1.37 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -7961,17 +7961,18 @@ var TEXT_ROLE_REASONS = /* @__PURE__ */ new Set([
|
|
|
7961
7961
|
]);
|
|
7962
7962
|
var SEVERE_TABLE_REASONS = /* @__PURE__ */ new Set(["multi_page_table_candidate"]);
|
|
7963
7963
|
var ReviewAssistanceWorkScheduler = class {
|
|
7964
|
-
build(context) {
|
|
7964
|
+
build(context, options) {
|
|
7965
7965
|
if (!context.reviewAssistanceEligibility.eligible) return [];
|
|
7966
|
-
|
|
7966
|
+
const items = [
|
|
7967
7967
|
...this.buildTextOcrItems(context),
|
|
7968
7968
|
...this.buildTextIntegrityItems(context),
|
|
7969
7969
|
...this.buildTextRoleItems(context),
|
|
7970
|
-
...this.buildTableItems(context),
|
|
7970
|
+
...options?.skipTableItems ? [] : this.buildTableItems(context),
|
|
7971
7971
|
...this.buildPictureCaptionItems(context),
|
|
7972
7972
|
...this.buildPictureSplitItems(context),
|
|
7973
7973
|
...this.buildLayoutItems(context)
|
|
7974
7974
|
];
|
|
7975
|
+
return items;
|
|
7975
7976
|
}
|
|
7976
7977
|
buildTextOcrItems(context) {
|
|
7977
7978
|
const targetRefs = context.textBlocks.filter(
|
|
@@ -9034,7 +9035,9 @@ var ReviewAssistanceRunner = class {
|
|
|
9034
9035
|
);
|
|
9035
9036
|
const image = new Uint8Array(await (0, import_promises7.readFile)(context.pageImagePath));
|
|
9036
9037
|
const scheduler = new ReviewAssistanceWorkScheduler();
|
|
9037
|
-
const workItems = scheduler.build(context
|
|
9038
|
+
const workItems = scheduler.build(context, {
|
|
9039
|
+
skipTableItems: !options.tableCorrectionEnabled
|
|
9040
|
+
});
|
|
9038
9041
|
if (workItems.length === 0) {
|
|
9039
9042
|
const result = {
|
|
9040
9043
|
pageNo: context.pageNo,
|
|
@@ -10487,6 +10490,7 @@ var PDF_CORRECTION_DEFAULTS = {
|
|
|
10487
10490
|
proposalThreshold: 0.5,
|
|
10488
10491
|
forceAutoApply: false,
|
|
10489
10492
|
reviewAssistanceEnabled: true,
|
|
10493
|
+
tableCorrectionEnabled: true,
|
|
10490
10494
|
temperature: 0
|
|
10491
10495
|
};
|
|
10492
10496
|
function normalizeNumber(value, fallback) {
|
|
@@ -10587,6 +10591,7 @@ function normalizePDFCorrectionOptions(value) {
|
|
|
10587
10591
|
proposalThreshold,
|
|
10588
10592
|
forceAutoApply: value.forceAutoApply ?? PDF_CORRECTION_DEFAULTS.forceAutoApply,
|
|
10589
10593
|
reviewAssistanceEnabled: value.reviewAssistanceEnabled ?? PDF_CORRECTION_DEFAULTS.reviewAssistanceEnabled,
|
|
10594
|
+
tableCorrectionEnabled: value.tableCorrectionEnabled ?? PDF_CORRECTION_DEFAULTS.tableCorrectionEnabled,
|
|
10590
10595
|
temperature: normalizeTemperature(
|
|
10591
10596
|
value.temperature,
|
|
10592
10597
|
PDF_CORRECTION_DEFAULTS.temperature
|
|
@@ -10655,6 +10660,7 @@ var PostDoclingCorrectionPipeline = class {
|
|
|
10655
10660
|
forceAutoApply: correction.forceAutoApply,
|
|
10656
10661
|
maxRetries: correction.maxRetries.reviewAssistance,
|
|
10657
10662
|
tableMaxRetries: correction.maxRetries.tableCorrection,
|
|
10663
|
+
tableCorrectionEnabled: correction.tableCorrectionEnabled,
|
|
10658
10664
|
temperature: correction.temperature,
|
|
10659
10665
|
outputLanguage: correction.outputLanguage,
|
|
10660
10666
|
aggregator: options.aggregator,
|