Skip to content

Commit

Permalink
Fixed bugs with Abbyy imports; added new test
Browse files Browse the repository at this point in the history
  • Loading branch information
Balearica committed Dec 19, 2024
1 parent fb26b14 commit d4010d3
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 3 deletions.
4 changes: 3 additions & 1 deletion js/import/convertPageAbbyy.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ export async function convertPageAbbyy({ ocrStr, n }) {

lineObj.orientation = textOrientationFinal;

lineObj.raw = xmlText;
// This should be kept disabled as a rule unless debugging.
// Enabling has caused crashes with large documents.
if (debugMode) lineObj.raw = xmlText;

let lettersKept = 0;
for (let i = 0; i < text.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions js/recognizeConvert.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ export async function convertPageCallback({
pageObj, dataTables, warn, langSet,
}, n, mainData, engineName) {
const fontPromiseArr = [];
if (langSet.has('chi_sim')) fontPromiseArr.push(loadChiSimFont());
if (langSet.has('rus') || langSet.has('ukr') || langSet.has('ell')) {
if (langSet && langSet.has('chi_sim')) fontPromiseArr.push(loadChiSimFont());
if (langSet && (langSet.has('rus') || langSet.has('ukr') || langSet.has('ell'))) {
fontPromiseArr.push(loadBuiltInFontsRaw('all'));
} else {
fontPromiseArr.push(loadBuiltInFontsRaw());
Expand Down
Loading

0 comments on commit d4010d3

Please sign in to comment.