How do mathematicians rigorously deal with words and sentences? In other words, how are words sentences constructed in a mathematical sense? Is there some (accepted) system for constructing words?
I know this is a rather broad question, but I am in the process of trying to think about "words" and "sentences" more rigorously, because often in computational mathematics we deal with sets of words or sets of sentences. These words are then transformed in some ways into the numerical domain to perform calculations on them.
An attempt could be as follows:
To start we may define a set containing all the symbols in a "language system", call it $\mathcal{S}$.
Then a word is just a finite combination of a subset of these symbols. We can either define as a relation $r: \{a_1, \ldots, a_n\} \subset \mathcal{S} \mapsto w$, or perhaps as an element of the power set of $\mathcal{S}$, say $\mathcal{W} := \mathcal{P}(\mathcal{S})$.
Then building upon this, a sentence would be some combination of words, i.e., $\mathcal{P}(\mathcal{W})$ where we define a function that puts the correct punctuations in place.
Just some thoughts. I wonder if people have tried to make this more rigorous.
Note: I have briefly studied regular expressions and formal language (long time ago) but I don't really think we necessarily have to abstract everything to the $0$s and $1$s to make sense of words.