Skip to content

Commit d1292cd

Browse files
authored
Merge pull request #77 from DataFog/chore/housekeeping
updated textservice to not catch empty strings
2 parents b1e789f + 48c4c1e commit d1292cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

datafog/services/text_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@ def _annotate_with_engine(
127127
# Try regex first
128128
regex_dict = self.regex_annotator.annotate(text)
129129

130-
# Check if any entities were found
130+
# Check if any VALID entities were found (ignore empty strings)
131131
has_entities = any(
132-
len(entities) > 0 for entities in regex_dict.values()
132+
any(entity.strip() for entity in entities)
133+
for entities in regex_dict.values()
133134
)
134135

135136
# If regex found entities, return those results

0 commit comments

Comments
 (0)