1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-07-12 11:59:58 +02:00
Commit graph

10 commits

Author SHA1 Message Date
14421c8e53 🎨 dinglehopper: Reformat using black 2020-11-10 12:29:55 +01:00
Benjamin Rosemann
c02569b41e Fix f-strings for Python 3.5 2020-10-29 12:33:54 +01:00
Benjamin Rosemann
7b27b2834e More complex sorting for text extraction
When extracting text from TextEquiv nodes we may encounter nodes without
index or nodes that should get sorted via the conf attribute.

Therefore we added a more complex algorithm to extract a TextEquiv and
inform the user via log messages if we encounter structures that we can
handle but may produce unexpected results.
2020-10-29 10:03:40 +01:00
Benjamin Rosemann
6ff831dfd2 Sort textlines with missing indices
Python's `sorted` method will fail with a TypeError when called with
`None` and Integers:

```python
>>> sorted([None, 1])
TypeError: '<' not supported between instances of 'int' and 'NoneType'
```
Therefore we are using `float('inf')` instead of `None` in case of
missing textline indices.
2020-10-29 10:03:40 +01:00
19d15e3ecc 🐛 dinglehopper: Honor TextEquiv index (Closes GH-33) 2020-10-21 17:50:21 +02:00
c514abfb9f 🧹 dinglehopper: Sanitize imports 2020-10-08 13:33:19 +02:00
a17ee2afec 🚧 dinglehopper: Guarantee NFC + rename from_text → from_str 2020-10-08 11:25:01 +02:00
96b55f1806 🚧 dinglehopper: Hierarchical text representation 2020-10-07 18:31:52 +02:00
9f05e6ca4c 🧹 dinglehopper: Remove obsolete XXX about None ids 2020-06-18 13:27:59 +02:00
4e182e0794 🚧 dinglehopper: Extract text while retaining segment id info 2020-06-18 13:27:59 +02:00
Renamed from extracted_text_test.py (Browse further)