AI Glossary / Graphs and symbolic AI / Intermediate
Characters
Definition
Characters are the written-text elements that a system represents and processes, such as letters, digits, punctuation, and other symbols. In computing, the word can refer to different units: an abstract character, a Unicode code point, or a user-perceived text element. AI text systems need a clear definition because these units are not always interchangeable.
What it means
A person sees text on a screen, but software stores an encoded representation. One visible element can require several code points, and one code point can require several bytes in a particular encoding. A model's tokens add another layer: they may correspond to parts of words, whole words, bytes, or other units depending on the tokenizer.
The practical lesson is to state what is being counted or indexed. A character limit, text offset, and model context limit can describe different quantities. Confusing them can break highlighting, truncate text incorrectly, or make a multilingual interface behave inconsistently.
How it works
Text is encoded into numerical units for storage and decoded for processing. Unicode supplies code points and properties, while encodings such as UTF-8 specify how code points are represented as bytes. Rendering turns the text representation into visible glyphs according to fonts and shaping rules.
For operations closer to what users perceive as individual text elements, software can use grapheme-cluster segmentation. A cluster may contain a base letter and combining marks or another supported multi-code-point sequence. AI preprocessing may then tokenize the text in a separate way. These stages serve different purposes and should preserve mappings when an application must connect predictions back to the original text.
Three practical examples
- A text-extraction interface highlights the exact source span supporting an AI-generated field, requiring offsets compatible with the stored text representation.
- A multilingual form counts user-perceived text elements rather than accidentally treating every byte as a separate character.
- A language-model application distinguishes its token budget from the number of letters or symbols visible in the prompt.
Think of it this way
Think of a printed word, its typesetting instructions, and the file bytes as different descriptions of the same text. Counting marks on the page is not the same as counting storage units. The analogy is limited because text shaping can combine or reposition symbols, and user perception is not always captured perfectly by a single universal counting rule.
Worked example
Consider the text “café” in two Unicode representations. In the first, the final letter is the precomposed code point U+00E9. The text has four code points. In the second, the final letter is represented by U+0065, the ordinary e, followed by U+0301, a combining acute accent. That representation has five code points.
Under the usual extended-grapheme interpretation, both have four grapheme clusters. In UTF-8, the first representation occupies five bytes: three ASCII letters plus two bytes for U+00E9. The second occupies six bytes: four ASCII letters plus two bytes for U+0301. The visible spelling can be the same even though code-point and byte counts differ. Appropriate Unicode normalization can bring canonically equivalent forms into a consistent representation, but normalization is a defined operation, not permission to strip accents or alter names arbitrarily. Token counts depend on the particular tokenizer and are not inferred from these counts.
Illustrative case study
At fictional Elm Documents, a review screen highlights the wrong portion of a multilingual sentence after an AI service returns offsets. Developers find that one component counts bytes and another counts code points. They document the offset convention and maintain a mapping when text is normalized before analysis.
The team checks examples with combining marks as well as simple English text. This fictional case illustrates an integration issue that can make correct extraction look wrong. It does not claim that one offset convention is universally best or that a small test set covers every writing system.
Common misconceptions and mistakes
A character is not always one byte, and a visible symbol is not always one code point. A glyph is a rendered shape, not necessarily the underlying abstract character. A token is a model-processing unit and should not be described as a fixed number of characters across languages and inputs.
Also, visually similar text need not be identical in encoding or meaning. Conversely, different code-point sequences can be canonically equivalent. Blindly removing marks to simplify processing can damage language content. Finally, character-level models still need a precise definition of their units; the label alone does not tell whether they operate on code points, bytes, or another representation.
Business use
Businesses building AI text workflows should define text units at integration boundaries. This matters for field limits, search matching, annotations, document redaction, and user-visible counts. Preserve the original text when transformations are applied, and ensure offsets can be traced back reliably. Multilingual quality depends partly on these representation details, even when the main AI model appears to handle the language well.
People also ask
Is every Unicode code point a complete visible character?
No. Some combine with others or serve nonprinting roles.
Does a four-character word always use four bytes?
No. The encoding and representation determine byte length.
Can character count predict model token count exactly?
Not generally. Tokenization rules and the actual text determine the token sequence.
Check your understanding
A letter plus a combining accent uses two code points but appears as one text element. Should a user-visible cursor necessarily split it in the middle?
Answer: Not merely because there are two code points. Grapheme-aware behavior can treat the combined element as a unit, subject to the application's text-editing conventions.
Related terms
- Unicode
- Code point
- UTF-8
- Tokenization
- Normalization
- grapheme cluster
- character encoding
Learn next
Compare byte, code-point, and grapheme counts for a short set of multilingual strings. Then inspect the tokenizer used by the intended AI system. Keep the resulting counts labeled by unit so limits and text positions remain meaningful across components.
More in Graphs and symbolic AI
- Chain rule - The chain rule of probability expresses a joint probability as a product of successive conditional probabilities.
- Chains - Chains, in the graph-algorithm sense used here, are paths or cycles produced by a chain decomposition based on a depth-first search tree.
- Chance nodes - Chance nodes represent uncertain outcomes in a decision tree, game tree, or decision network.
- Child node - A child node is a node directly below another node, its parent, in a rooted tree.
- Chordal - Chordal describes an undirected graph in which every cycle of four or more vertices has a chord: an edge connecting two vertices that are not consecutive on...
- Choreography - Choreography is a description or coordination pattern for how multiple participants interact through messages and agreed behavior.
Sources
Sources: Unicode Consortium, official Characters and Combining Marks FAQ: https://www.unicode.org/faq/char_combmark.html . Unicode Standard Annex 29, Text Segmentation: https://www.unicode.org/reports/tr29/ . AIMA original index, text-processing context: https://aima.cs.berkeley.edu/aima-index.html .
Previous: Characteristic samples Next: Chart parsing