Screen-look check, tuning round: name screens, windows, PDFs, print and footers as screen work
Every term is now matched as a whole word (the boundaries used to bind only the first and last term), so 'build' no longer counts as 'ui'. Eight terms are added for screens, windows, UI, onboarding, PDFs, printable matter, footers and terminals; write, generate and produce count as making. The four look groups are one compiled expression. Train 0.95 (38 of 40), held 0.96 (22 of 23), every real row right.
This commit is contained in:
1 parent
74afc795a2
commit
7c44dc2b68
2 files changed
+9
-7
No files matched your search
+7
-7
@@ -152,19 +152,19 @@ def prompt(p):
|
||||
|
||||
# A brief states no look when it makes something (MAKING), names two or more of SCREEN and has neither a `Look:` / `Design system:` line nor three
|
||||
# of the four GROUPS (type, colour, spacing, grid). Each entry is a regular expression, tried against the lowercase brief.
|
||||
SCREEN = ("layouts?", "screenshots?", "viewports?", "phone[- ]widths?", "responsive", "stylesheets?", "css", "dark mode", "light and dark",
|
||||
"typefaces?", "toolbars?", "sidebars?", "modals?", "dialog box(?:es)?", "cards?", "panels?", "charts?", "buttons?", "headlines?", "wraps", "scroll\\w*")
|
||||
_SCREEN = re.compile(r"\b(" + r")|(".join(SCREEN) + r")\b")
|
||||
MAKING = re.compile(r"\b(?:build\w*|creat\w*|mak(?:e|es|ing)\b|(?:re)?design\w*|restyle\w*|adds?\b|adding\b|lay(?:s|ing)? out|implement\w*)")
|
||||
GROUPS = tuple(re.compile(p) for p in (r"fonts?|typefaces?|typography|type scale|helvetica|arial|roboto|georgia|garamond|times new roman|system-ui|sans-serif|segoe ui|sf pro|\binter\b",
|
||||
r"#[0-9a-f]{3,8}\b|palettes?|colou?r schemes?", r"padding|margins?|\bgaps?\b|spacing|radius", r"\bgrids?\b|columns?|breakpoints?"))
|
||||
SCREEN = ("layouts?", "screens?", "screenshots?", "windows?", "viewports?", "phone[- ]widths?", "responsive", "stylesheets?", "css", "dark mode", "light and dark",
|
||||
"typefaces?", "toolbars?", "sidebars?", "modals?", "dialog box(?:es)?", "cards?", "panels?", "charts?", "buttons?", "headlines?", "wraps", "scroll\\w*",
|
||||
"ui", "onboarding", "pdfs?", r"print(?:able|er|ing|ed)", "footer", "terminal")
|
||||
_SCREEN = re.compile(r"\b(?:(" + r")|(".join(SCREEN) + r"))\b")
|
||||
MAKING = re.compile(r"\b(?:build\w*|creat\w*|mak(?:e|es|ing)\b|(?:re)?design\w*|restyle\w*|adds?\b|adding\b|lay(?:s|ing)? out|implement\w*|writ(?:e|es|ing)\b|generat(?:e|es|ing)\b|produc(?:e|es|ing)\b)")
|
||||
GROUPS = re.compile(r"((?:fonts?|typefaces?|typography|type scale|helvetica|arial|roboto|georgia|garamond|times new roman|system-ui|sans-serif|segoe ui|sf pro|\binter\b))|((?:#[0-9a-f]{3,8}\b|palettes?|colou?r schemes?))|((?:padding|margins?|\bgaps?\b|spacing|radius))|((?:\bgrids?\b|columns?|breakpoints?))")
|
||||
LOOK_LINE = re.compile(r"(?im)^\W{0,6}(?:look|design system)\s*:")
|
||||
|
||||
|
||||
def screen_brief_without_look(text):
|
||||
"""True when a brief asks for something the person will look at and states no look for it. Anything that is not text is False."""
|
||||
t = text.lower() if isinstance(text, str) else ""
|
||||
return bool(MAKING.search(t)) and len({m.lastindex for m in _SCREEN.finditer(t)}) >= 2 and not LOOK_LINE.search(t) and sum(bool(g.search(t)) for g in GROUPS) < 3
|
||||
return bool(MAKING.search(t)) and len({m.lastindex for m in _SCREEN.finditer(t)}) >= 2 and not LOOK_LINE.search(t) and len({m.lastindex for m in GROUPS.finditer(t)}) < 3
|
||||
|
||||
|
||||
def watch(p):
|
||||
|
||||
Reference in new issue
Block a user