Skip to content

Commit ba1c049

Browse files
author
Pleias
authored
Update ocr_function.py
1 parent 647d5d3 commit ba1c049

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ocroscope/ocr_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def split_text(text, segment_length, sample_size = None, min_letter_ratio = .3):
5454

5555
#We activate the sampling mode if there is a sample_size specified and if the number of segments in the text is longer the sample size.
5656
if sample_size is not None:
57-
if num_segments >= sample_size:
57+
if len(list_segment) >= sample_size:
5858
list_segment = sample(list_segment, sample_size)
5959

6060
return list_segment, nonchar_content

0 commit comments

Comments
 (0)