MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / _convert_text

Function _convert_text

scripts/website/americanize_spelling.py:103–113  ·  view source on GitHub ↗
(text, counts)

Source from the content-addressed store, hash-verified

101
102
103def _convert_text(text, counts):
104 def repl(mobj):
105 w = mobj.group(0)
106 american = MAPPING.get(w.lower())
107 if not american:
108 return w
109 out = _apply_case(w, american)
110 if out != w:
111 counts[w.lower() + " -> " + american] += 1
112 return out
113 return _WORD_RE.sub(repl, text)
114
115
116def _convert_line(line, counts):

Callers 1

_convert_lineFunction · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected