Commit Graph

142 Commits (68a12f8f7f7b82c47e06c8f65a921b7ebc1368c9)

Author SHA1 Message Date
Mike Gerber de6cd8f1e7 Make joining grapheme clusters more robust by checking joiner and handling an empty joiner
Mike Gerber 7c6ee593f0 🐛 Fix score_hint call in cli_line_dirs
Mike Gerber 618ea567de 🐛 Fix docstring of distance() for grapheme clusters
Mike Gerber e256526ea1 🐛 Fix calculation of score_hint for edge cases, e.g. when CER is infinite
If the CER is infinite, we can't calculate a score_hint as an int. Fall back to None
in this case.
Mike Gerber bc95c03127 🕸Do not use deprecated ID, pageId options
See gh-75.
Mike Gerber 7fef02bf0a ✔ Add mets:FLocat's @LOCTYPE/OTHERLOCTYPE to test data
Newest OCR-D wasn't happy with the test data anymore (see gh-89). I'm not sure if the
test data was invalid the way it was, but having a LOCTYPE certainly is "prettier" so
adding it. This fixes the test again.
Gerber, Mike a18b25b163 🐛 Update tests for ExtractedText
In PR gh-72, @maxbachmann introduced a new argument for ExtractedText(). Update the
corresponding tests.
Max Bachmann f48e305347
use uniseg again
Max Bachmann d2bbc8a6c7 update rapidfuzz version
Max Bachmann a1f0a5e2d3 replace uniseg with uniseg2
Max Bachmann 22c3817f45 apply black
Max Bachmann 01571f23b7 move grapheme clusters to ExtractedText
Max Bachmann f211d09f56 remove python2.7 futures
Max Bachmann 205a969c0e remove unused includes
Max Bachmann f3825cdeb6
only call `words_normalized` once
Gerber, Mike dcc10c5389 ✔️ Skip test_lines_similar() for now
test_lines_similar() fails with rapidfuzz 2.5 and is flawed anyway:

The test was based on our own implementation that used __eq__ and not __hash__ as
rapidfuzz does. Need to review this in the future.
Gerber, Mike 555f586775 📝 Note that old terminals might not render the Unicode characters correctly
Gerber, Mike c4e85da5ab 🐛 Update editops() and seq_align() due to RapidFuzz API changes
Gerber, Mike 15dfbac3a7 Revert "Revert "Merge pull request from maxbachmann/rapidfuzz""
This reverts commit 76bd50f1db.
Gerber, Mike 76bd50f1db Revert "Merge pull request from maxbachmann/rapidfuzz"
This reverts commit 85f751aacc, reversing
changes made to 1febea8c92.
Max Bachmann e543438496 replace usage of deprecated rapidfuzz APIs
Gerber, Mike d726396002 👷🏾‍♂️ Remove str() on Path objects
As of Python 3.6 we don't need to call str() on Path objects anymore.

See also gh-20.
Gerber, Mike 8a3f5e48c2 🐛 dinglehopper: Patch word_break only once
Previously, we (accidently) patched uniseg's word_break on every call
to words(). Do it only once.
Gerber, Mike f77ce857b2 🚧 dinglehopper: Sahre json_float code
Gerber, Mike 5b394649a7 🚧 dinglehopper: Compute WER in line-dirs CLI
Gerber, Mike cb2be96179 🚧 dinglehopper: Add word differences in line-dirs report
Gerber, Mike dbb660615a 🚧 dinglehopper: Compare line text directories (WIP)
Gerber, Mike a018006f98 🚧 dinglehopper: Compare line text directories (WIP)
Gerber, Mike 36b36f6986 🚧 dinglehopper: Compare line text directories (WIP)
Gerber, Mike 06ea38449c 📝 dinglehopper: Update Levenshtein notebook
Gerber, Mike 3ee688001a 🧹 dinglehopper: Directly import levenshtein() from rapidfuzz
Gerber, Mike 5d496df267 dinglehopper: Remove tests that only test rapidfuzz's levenshtein()
Gerber, Mike 091f069b3c dinglehopper: Remove tests that only test rapidfuzz's levenshtein_ops()
Gerber, Mike af8da1d716 dinglehopper: Use rapidfuzz for editops
Gerber, Mike 249787686f Merge branch 'master' of github.com:qurator-spk/dinglehopper
Gerber, Mike 2a6cc5823e 🐛 dinglehopper: Call initLogging before logging
When using ocrd_utils' getLogger(), we need to call initLogging() before doing any
logging.

Fixes .
Konstantin Baierer 7fde00d911 ReadingOrder may also contain UnorderedGroupIndexed
Gerber, Mike 1778b36a9a 🚧 dinglehopper: Read PAGE UnorderedGroup in XML order
Benjamin Rosemann a68fc269d9 Fix the extraction of text from Page with TableRegion
Dinglehopper did not consider `OrderedGroupIndex` in the `ReadingOrder`
element when extracting text regions. As a consequence a `TableRegion`
was not considered for text extraction.
Konstantin Baierer 74e0ac18ed ocrd cli: use core-provided zip_input_files method
Gerber, Mike 389e253c11 🐛 dinglehopper: Fix alto_extract_lines()'s type annotation
Gerber, Mike fe3923a8af 🐛 dinglehopper: Fix alto_extract()'s type annotation
Gerber, Mike 132f91d500 ✔️ dinglehopper: Add missing integration test markers
Benjamin Rosemann ce752e1912 Remove .idea folder and modify .gitignore
Sharing even parts of the .idea folder in worldwide setting is bound to
generate more problems than solutions. Therefore it should be removed
and consequently ignore in .gitignore.

Also adds some Python specific stuff to the .gitignore file.
Benjamin Rosemann 5270737c1f Skip test on windows because it is unix specific.
Gerber, Mike 32a4b95a99 🐛 dinglehopper: Normalize in plain_extract()
Gerber, Mike 14421c8e53 🎨 dinglehopper: Reformat using black
Gerber, Mike 31c63f9e4c 🎨 dinglehopper: s/LOG/log
Robert Sachunsky a60c14351e
1 more update for core's getLogger context
Benjamin Rosemann c02569b41e Fix f-strings for Python 3.5