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

Function is_accepted

scripts/developer-guide/run_languagetool.py:431–443  ·  view source on GitHub ↗
(flagged_text, accept_re, surrounding_after="")

Source from the content-addressed store, hash-verified

429
430
431def is_accepted(flagged_text, accept_re, surrounding_after=""):
432 if not flagged_text:
433 return False
434 if accept_re and accept_re.match(flagged_text):
435 return True
436 # Treat the flagged token as part of a dotted or underscored
437 # identifier ("android.permission", "win.shortcutName",
438 # "android.cusom_layout1"). Such matches are almost always build-hint
439 # or config keys, and the sources legitimately use lowercase
440 # identifiers as table cells / list labels.
441 if surrounding_after and _CONTEXT_CODE_RE.match(surrounding_after):
442 return True
443 return False
444
445
446def run_languagetool(text, language="en-US", accept_re=None):

Callers 1

run_languagetoolFunction · 0.85

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected