Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/copyright/detector/tests_copyright_holder_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,36 @@ fn test_mit_intro_not_copyright_or_holder() {
);
}

#[test]
fn test_confidential_notice_trade_secret_phrase_not_detected_as_copyright() {
let input = concat!(
"/*\n",
" * Copyright Acme Inc. and its affiliates.\n",
" * The information contained herein is protected by applicable copyright and trade secret law.\n",
" */\n",
);
let (copyrights, holders, _authors) = detect_copyrights_from_text(input);

assert!(
copyrights
.iter()
.any(|c| c.copyright == "Copyright Acme Inc. and its affiliates"),
"copyrights: {copyrights:?}"
);
assert!(
!copyrights
.iter()
.any(|c| c.copyright == "copyright and trade secret"),
"copyrights: {copyrights:?}"
);
assert!(
holders
.iter()
.any(|h| h.holder == "Acme Inc. and its affiliates"),
"holders: {holders:?}"
);
}

#[test]
fn test_rest_api_description_not_holder_or_copyright() {
let input = "We provide developers, researchers, and students the ability to access any model using a simple REST API call. The REST API description.";
Expand Down
1 change: 1 addition & 0 deletions src/copyright/refiner/copyrights_junk_patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ pub(super) static COPYRIGHTS_JUNK_PATTERNS: LazyLock<Vec<Regex>> = LazyLock::new
r"(?i)^copyright holder, author\b",
r"(?i)^copyright holders? disclaim\b",
r"(?i)^copyright and has\b",
r"(?i)^copyright and trade secrets?\b",
r"(?i)^copyright and trademark\b",
r"(?i)^copyright and other proprietary\b",
r"(?i)^copyright in the\b",
Expand Down
2 changes: 2 additions & 0 deletions src/copyright/refiner/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ fn test_is_junk_copyright_patents_trade_secrets() {
fn test_is_junk_copyright_trade_secrets_fragments() {
assert!(is_junk_copyright("copyrights, trade secrets or"));
assert!(is_junk_copyright("COPYRIGHT, TRADE SECRET OR"));
assert!(is_junk_copyright("copyright and trade secret"));
assert!(is_junk_copyright("COPYRIGHT AND TRADE SECRETS"));
assert!(is_junk_copyright(
"copyright, trade secret, trademark or other intellectual property rights of"
));
Expand Down
Loading