Skip to content

Commit e030211

Browse files
committed
fix(cluecode): reject sentence-glue NAME-DOT holders
Bare COMPANY:{NAME-DOT} and permissive NAME-DOT tails turned license prose (Assignment.This, Remedies.In, Corporation.All) into fake ignorable holders, failing validate shards 2/4. Keep Frankie.Chu author + Rocket.Chat year-holder dual-home; drop bare NAME-DOT company rule and block glue function-word tails. Signed-off-by: Alex Chen <andystechkin@gmail.com>
1 parent 1dce8e7 commit e030211

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/cluecode/copyrights.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,10 @@ def build_detection_from_node(
22362236
# so tokens like Xiph.Org/Iotacoffee.Com still fall through to URL/NNP patterns.
22372237
# NAME-DOT is intentionally not NNP: AUTHOR only matches AUTH + NAME-DOT for
22382238
# single-token Author:Name tags, avoiding false authors from bare AUTH NNP.
2239-
(r'^[A-Z][a-z0-9]+(?:\.(?!Org,?$|Com,?$|Net,?$|Edu,?$|Gov,?$|Inc,?$|Ltd,?$|Co,?$)[A-Z][a-z0-9]+)+,?$', 'NAME-DOT'),
2239+
# Also reject sentence-glue tails from missing spaces in license prose
2240+
# (Assignment.This, Remedies.In, Corporation.All) so dual-home copyright
2241+
# grammar cannot invent holders from section headers.
2242+
(r'^[A-Z][a-z0-9]+(?:\.(?!Org,?$|Com,?$|Net,?$|Edu,?$|Gov,?$|Inc,?$|Ltd,?$|Co,?$|This,?$|In,?$|All,?$|The,?$|Of,?$|And,?$|For,?$|By,?$|With,?$|From,?$|To,?$|As,?$|Or,?$|An,?$|At,?$|On,?$|Is,?$|Are,?$|Was,?$|Be,?$|If,?$|Not,?$|No,?$|Any,?$|Such,?$|That,?$|These,?$|Those,?$|When,?$|Where,?$|Which,?$|Who,?$|Will,?$|Shall,?$|May,?$|Can,?$|Must,?$|Should,?$|Would,?$|Could,?$|Rights,?$|Reserved,?$|Agreement,?$|Event,?$|Breach,?$|License,?$|Software,?$|Source,?$|Code,?$|File,?$|Files,?$|Notice,?$|Notices,?$|Subject,?$|Terms,?$|Conditions,?$|Section,?$|Clause,?$|Party,?$|Parties,?$)[A-Z][a-z0-9]+)+,?$', 'NAME-DOT'),
22402243

22412244
# proper noun with apostrophe ': D'Orleans, D'Arcy, T'so, Ts'o
22422245
(r"^[A-Z][a-z]?'[A-Z]?[a-z]+[,\.]?$", 'NNP'),
@@ -2714,9 +2717,10 @@ def build_detection_from_node(
27142717
COMPANY: {<NAME|NAME-EMAIL|NAME-YEAR|NNP>+ <OF> <NN>? <COMPANY|COMP> <NNP>?} #770
27152718
COMPANY: {<NNP> <COMP|COMPANY> <COMP|COMPANY>} #780
27162719
# Rocket.Chat Technologies Corp. / Foo.Bar Systems Inc. (NAME-DOT + company words)
2720+
# Do NOT accept bare {NAME-DOT} as COMPANY: license prose like Assignment.This
2721+
# / Remedies.In would become fake holders. Bare Rocket.Chat still works via
2722+
# NAME-YEAR {YR-RANGE NAME-DOT} when a year is present.
27172723
COMPANY: {<NAME-DOT> <COMP|COMPANY>+} #780.1
2718-
# bare product/org token used as a company name, e.g. Rocket.Chat
2719-
COMPANY: {<NAME-DOT>} #780.2
27202724
COMPANY: {<NN>? <COMPANY|NAME|NAME-EMAIL> <CC> <COMPANY|NAME|NAME-EMAIL>} #790
27212725
COMPANY: {<COMP|COMPANY|NNP> <NN> <COMPANY|COMPANY> <NNP>+} #800
27222726

0 commit comments

Comments
 (0)