Skip to content

Commit dfd920d

Browse files
committed
fix(cluecode): narrow Frankie.Chu author grammar to NAME-DOT
The previous AUTHOR rule {AUTH PN|NNP|CAPS|NN}+ was over-broad and matched false authors (e.g. "would like", single names, CVS keywords). Tag mixed-case dotted personal names as NAME-DOT (excluding common domain/org suffixes) and match only AUTH + NAME-DOT for Author:Frankie.Chu. Signed-off-by: Alex Chen <andystechkin@gmail.com>
1 parent 01f1528 commit dfd920d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/cluecode/copyrights.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,6 +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).
2235+
# 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.
2237+
(r'^[A-Z][a-z0-9]+(?:\.(?!Org,?$|Com,?$|Net,?$|Edu,?$|Gov,?$|Inc,?$|Ltd,?$|Co,?$)[A-Z][a-z0-9]+)+,?$', 'NAME-DOT'),
2238+
22342239
# proper noun with apostrophe ': D'Orleans, D'Arcy, T'so, Ts'o
22352240
(r"^[A-Z][a-z]?'[A-Z]?[a-z]+[,\.]?$", 'NNP'),
22362241

@@ -3479,8 +3484,8 @@ def build_detection_from_node(
34793484
# author (Panagiotis Tsirigotis)
34803485
AUTHOR: {<AUTH> <NNP><NNP>+} #author Foo Bar
34813486
3482-
# Author:Frankie.Chu / Author: Frankie.Chu (single dotted/simple name token)
3483-
AUTHOR: {<AUTH> <PN|NNP|CAPS|NN>+} #author Frankie.Chu
3487+
# Author:Frankie.Chu / Author: Frankie.Chu (single mixed-case dotted name token)
3488+
AUTHOR: {<AUTH> <NAME-DOT>} #author Frankie.Chu
34843489
34853490
# Author: Tim (xtimor@gmail.com)
34863491
AUTHOR: {<AUTH> <NNP>+ <EMAIL>+} #Author Foo joe@email.com

0 commit comments

Comments
 (0)