MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / re_search

Function re_search

NLP/Text2SQL-BASELINE/text2sql/utils/text_utils.py:332–352  ·  view source on GitHub ↗

Args: patt (TYPE): NULL text (TYPE): NULL Returns: TODO Raises: NULL

(patt, text)

Source from the content-addressed store, hash-verified

330
331
332def re_search(patt, text):
333 """
334
335 Args:
336 patt (TYPE): NULL
337 text (TYPE): NULL
338
339 Returns: TODO
340
341 Raises: NULL
342 """
343 lst_result = []
344 pos = 0
345 while True:
346 match = re.search(patt, text[pos:])
347 if match is None:
348 break
349 lst_result.append((match.start() + pos, match.end() + pos))
350 pos = pos + match.end() + 1
351
352 return lst_result
353
354
355CN_NUM = '〇一二三四五六七八九零壹贰叁肆伍陆柒捌玖貮两1234567890'

Callers 1

_extract_num_spanFunction · 0.85

Calls 4

searchMethod · 0.80
endMethod · 0.80
appendMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected