Skip to content

Commit

Permalink
Ran linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Balearica committed Oct 27, 2024
1 parent d54ba19 commit 7fc1508
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion js/export/export.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { inputData, opt } from '../containers/app.js';
import { layoutDataTables, layoutRegions, ocrAll, pageMetricsArr } from '../containers/dataContainer.js';
import {
layoutDataTables, layoutRegions, ocrAll, pageMetricsArr,
} from '../containers/dataContainer.js';
import { ImageCache } from '../containers/imageContainer.js';
import { reorderOcrPage } from '../modifyOCR.js';
import { saveAs } from '../utils/miscUtils.js';
Expand Down
2 changes: 0 additions & 2 deletions js/generalWorkerMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export async function initGeneralWorker() {
}

return new Promise((resolve, reject) => {

const errorHandler = (err) => {
console.error(err);
};
Expand All @@ -35,7 +34,6 @@ export async function initGeneralWorker() {
workerPromises['0'] = { resolve: innerResolve, reject: innerReject, func: 'ready' };
});


const messageHandler = async (data) => {
if (workerPromises[data.id]) {
if (data.status === 'reject') {
Expand Down
5 changes: 3 additions & 2 deletions js/import/convertPageBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import ocr from '../objects/ocrObjects.js';
import { pass2, pass3 } from './convertPageShared.js';

import { LayoutDataTablePage } from '../objects/layoutObjects.js';
import { ascCharArr, getTextScript, mean50, xCharArr } from '../utils/miscUtils.js';

import {
ascCharArr, getTextScript, mean50, xCharArr,
} from '../utils/miscUtils.js';

const baselineCharArr = [...xCharArr, ...ascCharArr];

Expand Down
1 change: 0 additions & 1 deletion js/import/convertPageStext.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export async function convertPageStext({ ocrStr, n }) {
const fontSizeStrI = fontStr?.match(/size=['"]([^'"]*)/)?.[1];
const baseline = parseFloat(letterOrFontArr[j][6]);
if (fontNameStrI && fontSizeStrI) {

// While small caps can be printed using special "small caps" fonts, they can also be printed using a regular font with a size change.
// This block of code detects small caps printed in title case by checking for a decrease in font size after the first letter.
// TODO: This logic currently fails when:
Expand Down
4 changes: 2 additions & 2 deletions js/utils/miscUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export function quantile(arr, ntile) {
}

/**
*
* @param {Array<number>} arr
*
* @param {Array<number>} arr
* @returns {number}
* This function returns `null` if the array is empty, however the TypeScript definition does not reflect this.
* Needing to implement type checks on every result is cumbersome, and generally not useful,
Expand Down
4 changes: 3 additions & 1 deletion scribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ import {
import { calcWordMetrics } from './js/utils/fontUtils.js';
import { getImageBitmap, imageStrToBlob } from './js/utils/imageUtils.js';
import { countSubstringOccurrences, getRandomAlphanum, replaceSmartQuotes } from './js/utils/miscUtils.js';
import { calcConf, checkOcrWordsAdjacent, mergeOcrWords, splitOcrWord } from './js/utils/ocrUtils.js';
import {
calcConf, checkOcrWordsAdjacent, mergeOcrWords, splitOcrWord,
} from './js/utils/ocrUtils.js';
import { assignParagraphs } from './js/utils/reflowPars.js';
import { writeXlsx } from './js/export/writeTabular.js';
import { calcColumnBounds } from './js/utils/detectTables.js';
Expand Down

0 comments on commit 7fc1508

Please sign in to comment.