MCPcopy Index your code
hub / github.com/clips/pattern / zshift

Function zshift

pattern/text/en/inflect_quantify.py:80–88  ·  view source on GitHub ↗

Returns a (string, count)-tuple, with leading zeros strippped from the string and counted.

(s)

Source from the content-addressed store, hash-verified

78 "zero", "minus", "point", ",", "and"
79
80def zshift(s):
81 """ Returns a (string, count)-tuple, with leading zeros strippped from the string and counted.
82 """
83 s = s.lstrip()
84 i = 0
85 while s.startswith((ZERO, "0")):
86 s = re.sub(r"^(0|%s)\s*" % ZERO, "", s, 1)
87 i = i + 1
88 return s, i
89
90#print zshift("zero one") # ("one", 1)
91#print zshift("0 0 seven") # ("seven", 2)

Callers 3

numberFunction · 0.85
numeralsFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…