Skip to content

Commit 46dc17d

Browse files
committed
A few more adjustments
1 parent ef9e478 commit 46dc17d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/content-modules/normalize-titles.pl

+10-5
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ ($)
4949
# Capitalize the first word unless it is mixed case
5050
$str =~ s/^([a-z][a-z0-9]*)\b/\u$1/;
5151

52-
# Handle exception
53-
$str =~ s/(ASP.NET) core/$1 Core/;
52+
# Handle exceptions
53+
$str =~ s/(.NET) (core)/$1 \u$2/;
54+
$str =~ s/(AI) (inference)/$1 \u$2/;
55+
$str =~ s|google cloud|Google Cloud|i;
56+
$str =~ s|pub/sub|Pub/Sub|;
5457

5558
return $str;
5659
}
@@ -88,20 +91,20 @@ ()
8891
$linkTitle = $1;
8992
}
9093

91-
$linkTitle = 'Attributes' if $title eq 'General Attributes';
9294
$linkTitle = 'Events' if $linkTitle =~ /Mobile Events/;
9395
$linkTitle = 'Connect' if $title =~ /Connect RPC$/i;
9496
$linkTitle = 'HTTP' if $linkTitle =~ /^HTTP Client and Server/i;
9597
$linkTitle = 'SQL' if $title =~ /SQL Databases$/i;
9698
$linkTitle = 'System use cases' if $title =~ /System .*?General Use Cases/i;
97-
$linkTitle = $1 if $title =~ /GenAI (\w+)$/i;
99+
$linkTitle = $1 if $title =~ /Gen(?:erative) ?AI (\w+)$/i && $title !~ /Systems$/i;
100+
$linkTitle = $1 if $title =~ /(OpenAI) \w+$/i;
98101

99102
# Missing an `s` in "Semantic Convention"?
100103
if ($title =~ /^Semantic Convention\b/i and $title !~ /Groups$/i) {
101104
$title =~ s/Semantic Convention\b/$&s/ig;
102105
printf STDOUT "> $title -> $linkTitle - added 's' to 'Conventions'\n";
103106
}
104-
$linkTitle =~ s/^Database Client //;
107+
$linkTitle =~ s/^(Database|Messaging) Client //;
105108
if ($ARGV =~ /docs\/azure/) {
106109
$linkTitle =~ s/ Resource Logs?//i;
107110
$linkTitle =~ s/Azure //i;
@@ -114,6 +117,8 @@ ()
114117
unless $ARGV =~ /gen-ai-metrics/;
115118
$linkTitle =~ s/ (components|guide|queries|supplementary information|systems|platform)$//i;
116119
$linkTitle =~ s/ \(command line interface\)//i;
120+
$linkTitle =~ s/ resources$//i;
121+
$linkTitle =~ s/(Process) and process runtime$/$1/i;
117122

118123
$linkTitle = '.NET' if $linkTitle =~ /.net common language runtime/i;
119124
$linkTitle = 'CLI' if $linkTitle =~ /\(command line interface\) programs/i;

0 commit comments

Comments
 (0)