Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCR #65

Merged
merged 16 commits into from
May 14, 2020
Merged

OCR #65

merged 16 commits into from
May 14, 2020

Conversation

yuliiabuchko
Copy link

No description provided.

@yuliiabuchko yuliiabuchko requested a review from apardyl May 5, 2020 16:52
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
gradle/wrapper/gradle-wrapper.properties Outdated Show resolved Hide resolved
@yuliiabuchko yuliiabuchko requested a review from apardyl May 6, 2020 11:09
@yuliiabuchko yuliiabuchko linked an issue May 12, 2020 that may be closed by this pull request
Copy link
Member

@apardyl apardyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks almost ok, please manually check if it works on pdf files from mordor.ksi.ii.uj.edu.pl

Copy link
Member

@apardyl apardyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok, just some nits

if (content == null) {
return null
}
val modified = content.replace('\n', ' ').replace('\t', ' ')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val modified = content.replace('\n', ' ').replace('\t', ' ')
val modified = content.replace("\\s".toRegex(), " ")

return ImageTextExtractor(tessBaseAPI).extract(file, maxLength)
}
} catch (e: IOException) {
logger.error("File can not be read", e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.error("File can not be read", e)
logger.warn("File can not be read: " + file.absolutePath, e)

@yuliiabuchko yuliiabuchko merged commit 4355720 into ms-1 May 14, 2020
@yuliiabuchko yuliiabuchko deleted the ocr_new branch May 14, 2020 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Execute OCR on the scanned documents
3 participants