Skip to content

Commit 1be0ee9

Browse files
Update ocr.py
1 parent 9b5ac32 commit 1be0ee9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ocr.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ def add_timepoint(self, anno, mmif, skip_if_view_has_frames=True):
129129

130130
def add_text_document(self, anno):
131131
t = anno.properties.get("text_value") or anno.text_value
132-
text_val = re.sub(r'([\\\/\|\"\'])', r'\1 ', t)
133-
self.text = self.text + [text_val] if text_val not in self.text else self.text
132+
if t:
133+
text_val = re.sub(r'([\\\/\|\"\'])', r'\1 ', t)
134+
self.text = self.text + [text_val] if text_val not in self.text else self.text
134135

135136

136137
def get_ocr_frames(view, mmif):

0 commit comments

Comments
 (0)