Skip to content

Commit 1dce8e7

Browse files
committed
fix(cluecode): dual-home NAME-DOT for copyright holders
NAME-DOT keeps Author:Frankie.Chu detection narrow, while NAME-YEAR/COMPANY productions accept NAME-DOT so holders like Rocket.Chat Technologies Corp. still parse. Avoids broad AUTH+NNP which invents false authors (LiveKit/OpenVision). Signed-off-by: Alex Chen <andystechkin@gmail.com>
1 parent 9e665e2 commit 1dce8e7

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/cluecode/copyrights.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,9 +2231,11 @@ def build_detection_from_node(
22312231
# proper noun with some separator and trailing comma
22322232
(r'^[A-Z]+\.[A-Z][a-z]+,?$', 'NNP'),
22332233

2234-
# Mixed-case dotted personal name token, e.g. Frankie.Chu (C++ Author:Name tags).
2234+
# Mixed-case dotted personal/product name token, e.g. Frankie.Chu / Rocket.Chat.
22352235
# Keep this after exact NNP exceptions (Xiph.Org) and exclude common domain/org suffixes
2236-
# so tokens like Xiph.Org,/Iotacoffee.Com still fall through to URL/NNP patterns.
2236+
# so tokens like Xiph.Org/Iotacoffee.Com still fall through to URL/NNP patterns.
2237+
# NAME-DOT is intentionally not NNP: AUTHOR only matches AUTH + NAME-DOT for
2238+
# single-token Author:Name tags, avoiding false authors from bare AUTH NNP.
22372239
(r'^[A-Z][a-z0-9]+(?:\.(?!Org,?$|Com,?$|Net,?$|Edu,?$|Gov,?$|Inc,?$|Ltd,?$|Co,?$)[A-Z][a-z0-9]+)+,?$', 'NAME-DOT'),
22382240

22392241
# proper noun with apostrophe ': D'Orleans, D'Arcy, T'so, Ts'o
@@ -2561,6 +2563,9 @@ def build_detection_from_node(
25612563
25622564
# NAME-YEAR starts or ends with a YEAR range
25632565
NAME-YEAR: {<YR-RANGE> <NNP> <NNP>+} #350
2566+
# 2015-2020 Rocket.Chat Technologies Corp. (NAME-DOT accepted where NNP is needed)
2567+
NAME-YEAR: {<YR-RANGE> <NAME-DOT> <COMP|COMPANY|NNP|NN>+} #350.05
2568+
NAME-YEAR: {<YR-RANGE> <NAME-DOT>} #350.06
25642569
25652570
COPYRIGHT: {<COPY> <YR-RANGE> <NNP> <NN> <NNP> <NNP> <NNP> <EMAIL>} #350.1
25662571
@@ -2708,6 +2713,10 @@ def build_detection_from_node(
27082713
# Companies
27092714
COMPANY: {<NAME|NAME-EMAIL|NAME-YEAR|NNP>+ <OF> <NN>? <COMPANY|COMP> <NNP>?} #770
27102715
COMPANY: {<NNP> <COMP|COMPANY> <COMP|COMPANY>} #780
2716+
# Rocket.Chat Technologies Corp. / Foo.Bar Systems Inc. (NAME-DOT + company words)
2717+
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
27112720
COMPANY: {<NN>? <COMPANY|NAME|NAME-EMAIL> <CC> <COMPANY|NAME|NAME-EMAIL>} #790
27122721
COMPANY: {<COMP|COMPANY|NNP> <NN> <COMPANY|COMPANY> <NNP>+} #800
27132722

0 commit comments

Comments
 (0)