Skip to content
EntityQ835922· pop 36· linked from 367 articles

lexical analysis

Sign in to save

Also known as lexing

computing process of parsing a sequence of characters into a sequence of tokens

Wikidata facts

Show 2 more facts
Sources (3)

via Wikidata · CC0

~22 min read

Article

Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful lexical tokens belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives, punctuations etc. In case of a programming language, the categories include identifiers, operators, grouping symbols, data types and language keywords. Lexical tokenization is related to the type of tokenization used in large language models (LLMs) but with two differences. First, lexical tokenization is usually based on a lexical grammar, whereas LLM tokenizers are usually probability-based. Second, LLM tokenizers perform a second step that converts the tokens into numerical values.

Rule-based programs

Connections

Categories