Skip to content
Snippets Groups Projects

Allow extracting elements holding transcriptions without entities

Merged Eva Bardou requested to merge extract-page-without-entities into main
All threads resolved!
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -106,9 +106,10 @@ class ArkindexExtractor:
raise NoTranscriptionError(element.id)
transcription = random.choice(transcriptions)
stripped_text = transcription.text.strip()
if not self.tokens:
return transcription.text.strip()
return stripped_text
entities = get_transcription_entities(
transcription.id,
@@ -117,7 +118,7 @@ class ArkindexExtractor:
)
if not entities.count():
return transcription.text.strip()
return stripped_text
return self.translate(
entities_to_xml(
Loading