You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/for-contributors/Generator/name-processing.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,8 @@ and the `NameSplitterTests` test cases.
111
111
Numbers are always split out as their own individual token. This is because this is easier to work with and consistent
112
112
than special casing when numbers should "stick" to preceding or proceeding tokens.
113
113
114
+
Note: The codebase is inconsistent when referring to tokens, usually calling them "words" or "fragments" instead.
115
+
114
116
For example:
115
117
-`2D` is split as `2_D`
116
118
-`R32` is split as `R_32`
@@ -145,8 +147,6 @@ processed.
145
147
For specifics on how this process works and the exact behaviors, it is best to refer to the `NamePrettifier` source code
146
148
and the `NamePrettifierTests` test cases.
147
149
148
-
(TODO: Explain how prettification works alongside name splitting. Explain how acronyms are handled. Explain why number fragments are merged to preceding letter fragments and how this affects acronyms and pascal casing.)
149
-
150
150
### Name Prettification - Notable Decisions
151
151
152
152
#### Output of Fully Capitalized Names
@@ -170,7 +170,7 @@ Where this behavior matters is in the following case:
170
170
capitalized by default. This means `RG` is actually output as `Rg`.
171
171
-`RG32` is split as `RG_32`. Because this is an acronym of length 4, it is output as `Rg32`.
172
172
173
-
Notably, means that `RG` and `RG32` are consistently output as `Rg-`.
173
+
Notably, this means that `RG` and `RG32` are consistently output as `Rg-`.
174
174
175
175
In the code, this is implemented by merging number tokens with preceding letter tokens.
176
176
@@ -179,7 +179,7 @@ For example:
179
179
-`RG_32` is merged as `RG32`.
180
180
181
181
This can be argued to be a hack, but simplifies acronym length calculations and continues to work with the code that
182
-
handles pascal casing.
182
+
handles pascal casing, which simply uppercases the first character and lowercases the rest for each token.
0 commit comments