Skip to content

Commit 19f06af

Browse files
committed
Fix Bug
1 parent 4c684d8 commit 19f06af

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cyaron/string.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,9 @@ def random_paragraph(sentence_count_range, **kwargs):
101101
@staticmethod
102102
def random_regular(*args, **kwargs):
103103
pattern = args
104-
limit_len = kwargs.get("limit", NUMBERS)
105-
if limit_len is None or limit_len == 0:
106-
limit_len = 10
107-
if(list_like(args)):
104+
limit_len = int(kwargs.get("limit", default="10"))
105+
if (limit_len <= 1): limit_len = 10
106+
if (list_like(args)):
108107
pattern = random.choice(args)
109108
_x = xeger.Xeger(limit=limit_len)
110-
return _x.xeger(pattern)
109+
return _x.xeger(pattern)

0 commit comments

Comments
 (0)