-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.ps1
More file actions
56 lines (51 loc) · 1.42 KB
/
check.ps1
File metadata and controls
56 lines (51 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# check.ps1
# Publication hygiene check for P1 (CAE)
# Flags terms that indicate scope or ontological drift
$Root = "paper01"
$Files = Get-ChildItem $Root -Recurse -Include *.tex
$ForbiddenGroups = @{
"Category theory (P2 territory)" = @(
"morphism",
"functor",
"natural transformation",
"composition",
"bicategory",
"2-morphism"
)
"Exchange semantics (P2 territory)" = @(
"exchange pattern",
"admissibility",
"canonicalization",
"normalization"
)
"Explanation semantics (P3 territory)" = @(
"explanation",
"explanatory",
"vertical domain",
"fibered",
"CTag",
"spine"
)
"Causal or normative language (ontology risk)" = @(
"causes",
"leads to",
"results in",
"determines",
"effective",
"efficient"
)
}
Write-Host "`n=== P1 Ontology Drift Scan ===`n"
foreach ($group in $ForbiddenGroups.Keys) {
Write-Host ">> $group"
foreach ($term in $ForbiddenGroups[$group]) {
foreach ($file in $Files) {
$searchResults = Select-String -Path $file.FullName -Pattern "\b$term\b" -CaseSensitive:$false
foreach ($m in $searchResults) {
Write-Host " $($file.Name):$($m.LineNumber) '$term'"
}
}
}
Write-Host ""
}
Write-Host "Scan complete.`n"