I have a section of text that uses the mid-2000s online style of interspersing exclamation points with ones, for example (I’m sorry for the uninitiated):
Oh Draco!111111!1 Oh mi fuking gud Draco!1111
Semantically, those ones operate as exclamation points, but LaTeX doesn't know that. As described in questions “Is a period after an abbreviation the same as an end of sentence period?” and “What is the proper use of \@ (i.e., backslash-at)?” LaTeX uses the characters and their surroundings to determine interword versus intersentence spacing. Is there a way to change the character 1 to be treated as ! either throughout an entire document or within an environment? Preferably XeLaTeX-compatible.
Minimal Working Example:
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\begin{document}
\noindent Hi!1 I am Dan. This is \TeX.\
\noindent Hi!! I am Dan. This is \TeX.
\end{document}


1and!are the same catcode. For people looking for this in the future, what would be the case if they were different, for instance trying to work with the characterb? – Dan Jan 20 '21 at 23:04bif you wanted say&you'd have to stop it having the table cell meaning as well. – David Carlisle Jan 20 '21 at 23:12