Digraph
The term digraph has several meanings depending on the context.
In orthography, a digraph is a pair of successive letters in an alphabet that represent a single phoneme (distinct sound) or a value not equivalent to the sum of their individual sounds when used separately.[1][2] This device is fundamental in many languages, particularly English, where it simplifies spelling by combining letters to denote complex or blended sounds that single letters cannot adequately capture.[1][2]
Digraphs are classified into two main categories: consonant digraphs, which involve two consonants producing one sound, and vowel digraphs, which combine two vowels for a unified vowel sound.[3] Common English consonant digraphs include ch (as in "chair," pronounced /tʃ/), sh (as in "ship," pronounced /ʃ/), th (as in "think," pronounced /θ/, or "this," pronounced /ð/), ph (as in "phone," pronounced /f/), and wh (as in "what," often pronounced /hw/ or /w/).[1][2][4] Vowel digraphs, such as ea (as in "bread," pronounced /ɛ/), oa (as in "boat," pronounced /oʊ/), ai (as in "rain," pronounced /eɪ/), and ee (as in "see," pronounced /iː/), similarly merge to form diphthongs or long vowels.[1][3] These combinations are essential in phonics instruction, aiding early readers in decoding words by recognizing blended sounds rather than sounding out each letter individually.[3][4]
The term "digraph" entered English usage around 1780, derived from Greek roots meaning "two writings," reflecting its role in written representation of speech.[1] While digraphs enhance efficiency in alphabetic writing systems, they can introduce irregularities, as the same pair may vary in pronunciation across words or dialects—for instance, gh in "ghost" (/ɡoʊst/) versus "through" (/θruː/).[1][2] In linguistic analysis, digraphs differ from diacritics or ligatures, as they rely solely on standard letter pairs without additional marks.[3]
In graph theory, a digraph is a directed graph consisting of a set of vertices connected by edges with direction, often represented with arrows indicating the orientation from one vertex to another.[5]
In computing, particularly in programming languages such as C and C++, a digraph refers to a two-character sequence used as an alternative representation for certain punctuation or operator tokens, allowing compatibility with limited character sets.[6]
Orthography
Definition
A digraph, derived from the Greek prefix "di-" meaning "two" and "graphō" meaning "to write," was coined in the 18th century to denote a pair of letters or symbols in a writing system.[7] In orthography, a digraph consists of two consecutive letters that combine to represent a single phoneme or distinct sound unit, producing a pronunciation that differs from the separate sounds of the individual letters; for instance, unlike the additive sequence of "b" and "a" in "ba," a digraph forms a unified phonetic element. This contrasts with a monograph, a single letter representing one phoneme, and a trigraph, which employs three letters for a single sound.[8]
Digraphs emerged historically in alphabetic writing systems to address phonemes that existing single letters could not adequately capture, enabling more accurate representation of spoken sounds across languages.[9] Their development facilitated the adaptation of foreign sounds into native scripts, enhancing orthographic flexibility without expanding the alphabet.
In English orthography, digraphs saw their first systematic employment during the Middle English period (roughly 1100–1500 CE), primarily to incorporate loanwords from French and Greek that introduced unfamiliar phonemes.[9] French influences brought digraphs like "ch" for /tʃ/, while Greek loanwords contributed forms such as "ph" for /f/, reflecting transliterations of original Greek letters like phi (φ).[10][11]
Note that the term "digraph" also denotes a directed graph in mathematics, representing an unrelated homonym.[7]
Types and classification
Digraphs in orthography are classified based on their structural composition, the type of sound they represent, and their functional role in spelling systems.
A fundamental distinction is between vowel digraphs and consonant digraphs. Vowel digraphs consist of two vowels that together represent a single vowel phoneme, such as "ai" for /eɪ/ or "oa" for /oʊ/.[4] Consonant digraphs, by contrast, involve two consonants that combine to produce a single consonant phoneme, such as "ch" for /tʃ/ or "sh" for /ʃ/.[4] This classification highlights how digraphs adapt to the phonological categories of vowels and consonants within a language's sound system.[3]
Digraphs can also be categorized as homogeneous or heterogeneous depending on the letters involved. Homogeneous digraphs feature two instances of the same letter to denote a single sound, such as double letters indicating gemination in some languages. Heterogeneous digraphs, the more common type, use two distinct letters for one phoneme, such as "ng" for /ŋ/ or "ph" for /f/ in English, with the latter often appearing in loanwords from Greek origins. Heterogeneous digraphs may incorporate letters of varying etymological origins, contributing to orthographic heterogeneity in languages that borrow extensively, as seen when foreign spellings are retained in loanwords.
Another structural variation involves ligature digraphs versus non-ligature forms. Ligature digraphs fuse two letters into a single glyph while representing one phoneme, such as "æ" (ash) for /æ/ in historical English or Danish orthography.[12] Non-ligature digraphs, in contrast, remain as separate adjacent characters without graphical fusion, like "th" for /θ/ or /ð/.[12] This distinction arises from typographic and historical conventions, where ligatures reflect evolved letter forms.[13]
In terms of dialectal consistency, some digraphs function as pan-dialectical elements in unified orthographies, maintaining the same spelling across regional variations despite differing pronunciations. For instance, the English digraph "th" uniformly represents either the voiceless /θ/ (as in "thin") or voiced /ð/ (as in "this") in standard spelling, regardless of dialectal realizations.
Functionally, digraphs are often phonemic, mapping to a single distinct sound in the language's phoneme inventory, as with "ck" for /k/.[14] However, certain digraphs serve phonotactic purposes by denoting permissible sequences of sounds without creating a fused phoneme, distinguishing them from true blends where individual sounds remain audible.[15] This functional divide underscores how orthographies balance sound representation with permitted syllable structures.[16]
Examples in English
In English orthography, consonant digraphs are pairs of letters that represent a single consonant phoneme, often distinct from the sounds of the individual letters. Common examples include "ch" pronounced as /tʃ/, as in "church"; "sh" as /ʃ/, as in "ship"; "th" which can be voiced /ð/ as in "this" or voiceless /θ/ as in "think"; "ph" as /f/, as in "phone"; "ng" as /ŋ/, as in "sing"; and "wh" traditionally as /hw/ but often simplified to /w/ in modern American English, as in "what".[17]
Vowel digraphs, also known as vowel teams, consist of two vowels that together produce a single vowel sound or diphthong. Examples include "ai" as /eɪ/, as in "rain"; "ea" which varies, such as /iː/ in "eat" or /ɛ/ in "bread"; "oo" as /uː/ in "moon" or /ʊ/ in "book"; and "ou" as /aʊ/ in "out" or /ʌ/ in "touch".[18]
The combination "qu" functions as a semi-digraph, typically pronounced /kw/ as in "quick," and is often treated as a single orthographic unit despite comprising a consonant and vowel letter.[19]
Digraphs interact with English spelling rules, such as the "magic e" or silent e, which can create split digraphs by lengthening the preceding vowel sound; for instance, "cap" (/kæp/) contrasts with "cape" (/keɪp/), where the "a_e" forms a split digraph.[20]
Many English digraphs, including "ch," "sh," "ph," and "ou," trace their orthographic conventions to Norman French influences following the 1066 Conquest, which introduced Latin-derived spellings into Middle English.[21]
Examples in other languages
In languages beyond English, digraphs often serve to represent unique phonemes or diphthongs, reflecting historical phonological developments and orthographic conventions tailored to specific linguistic structures. These combinations are frequently treated as unitary elements in alphabets or sorting systems, highlighting cross-linguistic adaptations for sounds absent in the Latin script's basic form.[22]
Welsh employs several digraphs as distinct letters in its 28-letter alphabet, including "ll" and "ch". The digraph "ll" represents the voiceless lateral fricative /ɬ/, as heard in "Llanfairpwllgwyngyll", a sound produced by blowing air along the side of the tongue while keeping it against the teeth.[22] Similarly, "ch" denotes the voiceless velar fricative /χ/, akin to the "ch" in Scottish "loch" or German "Bach", as in the word "bach" meaning "small".[23] These digraphs are sorted as single units in dictionaries, underscoring their status as independent letters.[22]
In Czech, the digraph "ch" corresponds to the voiceless velar fricative /x/, pronounced as in "Bach", and follows "h" in the alphabet while being treated as a single phoneme in words like "chleba" (bread).[24] The letter "ř" is a single grapheme with a háček representing the raised alveolar non-sonant trill /r̝ʒ/, a trilled /r/ with simultaneous /ʒ/-like friction, unique to Czech and heard in "Dvořák".[25] This sound combines vibratory and fricative qualities, distinguishing it from standard /r/ or /ʒ/.[25]
French utilizes vowel digraphs to indicate nasal or rounded vowels not easily captured by single letters. The digraph "au" typically represents the mid-back rounded vowel /o/, as in "eau" (water), where it merges historically from earlier diphthongs into a monophthong.[26] "Eu" denotes the mid-front rounded vowel /ø/ in open syllables, like "peu" (little), or the open-mid /œ/ in closed ones, such as "deux" (two), with nasal variants like /œ̃/ in "peuvent".[27] These digraphs aid in consistent spelling despite French's complex vowel system.[27]
German digraphs address sibilants and diphthongs integral to its phonology. "Sch" is a trigraph functioning as a digraph equivalent, pronounced as the voiceless postalveolar fricative /ʃ/, similar to English "sh" in "Schule" (school).[28] The vowel digraph "ei" represents the closing diphthong /aɪ/, as in "Ein" (one), derived from Middle High German [ei̯] but shifted in pronunciation while retaining the spelling.[29] Such combinations are sorted as units in some contexts but follow individual letters in modern dictionaries.[29]
In Hawaiian, the diphthong "ae" appears in combinations like "ʻae" (yes), where the ʻokina (ʻ) marks a glottal stop /ʔ/ interrupting the /aɪ/ glide, essential for distinguishing meanings in this Polynesian language's 13-letter alphabet.[30] The ʻokina, treated as a consonant letter, integrates with vowel digraphs to preserve phonetic accuracy in orthography standardized in the 19th century.[31]
Irish Gaelic features aspirated digraphs reflecting lenition in its Celtic phonology. "Bh" is pronounced as the voiced labiodental fricative /v/ when slender (adjacent to front vowels like e or i), as in "beidh" (will be), or as the approximant /w/ when broad (near back vowels like a or o), such as "abhann" (river).[32] This digraph indicates a softened mutation of /b/, common in grammar, and is sorted as two letters in contemporary systems.[32]
Navajo orthography, developed in the 20th century for this Athabaskan language, uses digraphs for affricates among its 33 consonants. "Dz" represents the voiced alveolar affricate /dz/, as in "shidziil" (I have strength), combining a stop and fricative release without aspiration. This contrasts with aspirated "ts" /tsʰ/, and digraphs like "dz" are essential for denoting the language's rich ejective and affricate inventory in practical writing.
Spanish historically regarded "ll" as a single letter pronounced as a palatal lateral /ʎ/ (yeísmo variant /ʝ/), as in "llama" (flame), sorted separately until orthographic reforms. In 2010, the Real Academia Española reclassified "ll" and "ch" as digraphs rather than distinct letters, now collated under "l" and "c" in dictionaries for streamlined alphabetization while preserving their phonetic roles.[33] This change aligned Spanish with international conventions without altering word spellings.[33]
Graph theory
Definition and basic concepts
In graph theory, a digraph (short for directed graph) is formally defined as an ordered pair G = (V, A), where V is a finite nonempty set of elements called vertices or nodes, and A \subseteq V \times V is a set of ordered pairs called arcs or directed edges.[34] Each arc (u, v) \in A indicates a directed connection from vertex u (the tail) to vertex v (the head), modeling relationships with inherent directionality. This structure permits loops, where an arc connects a vertex to itself (i.e., (u, u) \in A), and multiple arcs between the same ordered pair of vertices, allowing for parallel directed connections.[35]
The term "digraph" was coined by mathematician Frank Harary in the 1950s, specifically appearing in his 1955 paper on enumerating certain graph structures, to distinguish these directed entities from traditional undirected graphs.[36] Unlike an undirected graph, where edges represent symmetric, bidirectional relations without specified orientation (e.g., mutual friendships in a social network), a digraph captures asymmetric or one-way interactions, such as one-way streets in a road network or dependencies in a task hierarchy.[37] This directional aspect enables digraphs to model real-world phenomena where traversal is not reciprocal, providing a foundational tool for analyzing oriented systems in mathematics and beyond.
A simple yet illustrative example of a digraph is a tournament, which is a directed orientation of a complete undirected graph: for every pair of distinct vertices u and v, there is exactly one arc, either (u, v) or (v, u), with no loops or multiple arcs.[38] Tournaments are particularly useful in studying comparative relations, such as ranking outcomes in competitions. Note that the term "digraph" is a homonym in linguistics, where it denotes a pair of characters representing a single phoneme, unrelated to this mathematical concept.
Notation and representations
In graph theory, a directed graph, or digraph, is formally denoted as D = (V, A), where V is a finite set of vertices and A \subseteq V \times V is the set of arcs, with each arc represented as an ordered pair (u, v) indicating a directed edge from vertex u (the tail) to vertex v (the head); the arrow notation u \to v is also commonly used to emphasize direction.[39] This notation distinguishes digraphs from undirected graphs by enforcing the order of vertices in each arc.
The adjacency matrix provides a compact matrix representation of a digraph with n = |V| vertices, labeled v_1, \dots, v_n. It is an n \times n matrix M = [m_{ij}] where m_{ij} = 1 if there is an arc from v_i to v_j, and m_{ij} = 0 otherwise; for weighted digraphs, entries store the corresponding weights instead of 1.[39][40]
An adjacency list representation structures the digraph as an array of lists, one per vertex, where the list for vertex v contains its out-neighbors N^+_D(v) = \{ u \in V \mid (v, u) \in A \} (vertices reachable by an outgoing arc) and optionally its in-neighbors N^-_D(v) = \{ w \in V \mid (w, v) \in A \}.[39][40] This format is efficient for sparse digraphs, as it only stores existing connections.
The incidence matrix B of a digraph with m = |A| arcs and n vertices is an m \times n matrix where each row corresponds to an arc and each column to a vertex; for the k-th arc from tail vertex i to head vertex j, the entry b_{k i} = -1, b_{k j} = 1, and all other entries in row k are 0.[39][41]
B = \begin{pmatrix}
-1 & 1 & 0 & \cdots & 0 \\
0 & -1 & 1 & \cdots & 0 \\
\vdots & \vdots & \ddots & \ddots & \vdots \\
0 & 0 & \cdots & -1 & 1
\end{pmatrix}
This formulation captures the orientation of arcs and is useful in linear algebraic analyses.
Visually, digraphs are represented in diagrams with vertices as points or labeled nodes and arcs as arrow-headed lines pointing from tail to head; self-loops, if present, are depicted as arrows curving back to the originating vertex.[39]
Digraphs may be extended to directed multigraphs, where multiple arcs between the same ordered pair (u, v) are allowed, denoted by including duplicates in A or tracking multiplicity \mu_D(u, v) (the number of such arcs) in matrix or list representations.[39]
Key properties
In directed graphs, or digraphs, connectivity is characterized in two primary ways. A digraph is weakly connected if its underlying undirected graph—obtained by ignoring arc directions—is connected, meaning there exists an undirected path between every pair of vertices.[42] In contrast, a digraph is strongly connected if there is a directed path from every vertex u to every other vertex v.[42][43]
Orientations of digraphs exhibit specific structural properties. An acyclic digraph contains no directed cycles, allowing for a topological ordering of its vertices where arcs only point forward in the order.[42] A tournament is a complete orientation of an undirected graph, where exactly one directed arc exists between every pair of distinct vertices.[42]
The in-degree and out-degree of a vertex v in a digraph D = (V, A) are defined as d^-(v) = |\{u \in V \mid (u, v) \in A\}|, the number of arcs entering v, and d^+(v) = |\{w \in V \mid (v, w) \in A\}|, the number of arcs leaving v, respectively.[42][43] The handshaking lemma for digraphs asserts that the sum of the out-degrees equals the sum of the in-degrees, both equaling the number of arcs:
\sum_{v \in V} d^+(v) = \sum_{v \in V} d^-(v) = |A|.
[42]
A digraph is Eulerian if it is strongly connected and every vertex has equal in-degree and out-degree, ensuring the existence of a directed Eulerian circuit that traverses each arc exactly once.[42] Determining the existence of a Hamiltonian path—a directed path visiting each vertex exactly once—in a general digraph is NP-complete.[44]
Common variants and extensions
Weighted digraphs extend basic digraphs by assigning a numerical weight to each arc, typically representing quantities such as distances, costs, or capacities.[45] These weights are often nonnegative real numbers, enabling the modeling of quantitative relationships between vertices.[45] A key application lies in shortest path algorithms, where weights denote path lengths; for instance, Dijkstra's algorithm efficiently computes the minimum-weight path from a source vertex to all others in a weighted digraph with nonnegative weights.
Multidigraphs generalize digraphs by permitting multiple arcs between the same ordered pair of vertices (u, v), allowing representation of parallel relations or capacities exceeding one.[46] This structure is useful in scenarios like transportation networks with multiple routes or communication systems with redundant links, where the multiplicity captures intensity or alternatives without altering the underlying topology.
Signed digraphs incorporate signs (+ or -) on arcs to model positive or negative relations, such as alliances or conflicts in social networks. Introduced in 1956 by Dorwin Cartwright and Frank Harary to formalize structural balance theory, they extend Fritz Heider's psychological ideas by analyzing semicycles: a signed digraph is balanced if every semicycle has an even number of negative arcs, corresponding to consistent relational structures.[47] Their 1956 work pioneered this framework, applying it to social sciences where balance implies partitionable groups into allies and antagonists.
An oriented graph represents a specific variant of a digraph obtained by assigning directions to the edges of an undirected graph without creating bidirectional arcs, thereby avoiding 2-cycles.[48] This orientation preserves acyclicity in certain contexts and is fundamental in tournament theory and asymmetric relations.
Further extensions include hyperdigraphs, where arcs connect more than two vertices, generalizing to directed hyperedges with tails and heads to model multi-way interactions like group decisions.[49] Bidirected graphs, meanwhile, treat each undirected edge as two oppositely directed arcs with independent orientations at endpoints, facilitating analysis of local directions in undirected settings.
Computing
Digraphs in programming languages
In the C programming language, digraphs are two-character sequences that serve as alternative representations for certain single-character punctuation tokens not available in all character encodings, such as variants of ISO/IEC 646 or EBCDIC.[50] These digraphs allow source code to be written portably across systems with limited character sets, where symbols like brackets and braces may be absent.[51] They were introduced to replace less readable trigraphs in many cases, providing a more intuitive way to express tokens during compilation.[50]
Digraphs were added via Amendment 1 to the ISO C90 standard (ISO/IEC 9899:1990/AMD1:1995, also known as C95), primarily to support portability to EBCDIC-based systems like those from IBM, which lack standard ASCII punctuation characters such as {, }, [, ], and #.[50] This amendment was incorporated into the full C99 standard (ISO/IEC 9899:1999) and has been retained in subsequent revisions, including C11 and C23. The feature addresses historical constraints from 7-bit character sets, ensuring C programs could compile without modification on diverse hardware.[50]
The following table lists the standard digraphs and their corresponding tokens:
| Digraph | Token |
|---|
<% | { |
%> | } |
<: | [ |
:> | ] |
%: | # |
%:%: | ## |
These mappings are exhaustive, limited to essential punctuation for minimal impact on the language grammar.[51][50]
During translation phase 3 of the C compiler, digraphs are recognized and replaced with their single-character equivalents before further lexical analysis, ensuring they are tokenized as atomic symbols rather than two separate characters.[51] This processing occurs after trigraph replacement but before directive handling, allowing digraphs like %: to function as the preprocessor directive marker.[50] For instance, the code snippet
<% int main() { return 0; } %>
<% int main() { return 0; } %>
is equivalent to
{ int main() { return 0; } }
{ int main() { return 0; } }
and compiles identically.[51]
Although related to trigraphs as a three-character extension for similar portability purposes, digraphs are distinct in their two-character form and broader adoption for readability.[50] Today, digraphs are rarely used due to widespread Unicode and ASCII support in modern development environments, but they remain fully valid and required for conformance in the C23 standard (ISO/IEC 9899:2024).[51][52] The same mechanism exists in C++, where digraphs were inherited from C and continue to be supported for compatibility.
In programming languages, particularly C, trigraphs are sequences of three characters, each beginning with two consecutive question marks (??), that serve as replacements for certain punctuation marks not available in limited character sets like the ISO 646 invariant code set.[53] These sequences enable source code portability across systems lacking full ASCII support by mapping to standard symbols during preprocessing.[54]
The standard trigraphs defined in C are as follows:
| Trigraph | Replacement |
|---|
| ??= | # |
| ??( | [ |
| ??/ | \ |
| ??) | ] |
| ??' | ^ |
| ??< | { |
| ??! | |
| ??> | } |
| ??- | ~ |
[53]
Trigraphs were introduced in the ANSI C standard of 1989 (later adopted as ISO/IEC 9899:1990) to facilitate programming on international systems with restricted character encodings.[54] They remained a required feature through subsequent revisions, including C99 and C11, but were fully removed in the C23 standard to simplify the language and reflect the obsolescence of such constraints in modern environments.[54] Compilers continue to support trigraphs for backward compatibility with legacy code, though this is no longer mandated.[53]
Trigraphs relate to digraphs—two-character alternatives like <: for [—as both mechanisms enhance portability by substituting for punctuation, and they are both processed during the first phase of translation, before directive recognition or tokenization.[55] However, key differences distinguish them: trigraphs always start with ?? and are substituted universally, including within string literals, character constants, and comments, whereas digraphs avoid ?? and function solely as alternative spellings for specific operator or delimiter tokens without affecting literals.[53]
For example, the code ??=include <stdio.h> is translated to #include <stdio.h> during preprocessing, allowing inclusion directives on keyboards without the # symbol.[53] Similarly, in a string literal like printf("What??!\n");, the trigraph ??! expands to |, producing the output "What|".[53]
Applications in text processing
In computational linguistics, digraphs play a key role in tokenization processes for phonetic analysis, where software identifies character pairs representing single phonemes. For instance, the Natural Language Toolkit (NLTK) leverages the CMU Pronouncing Dictionary to transcribe English text, mapping the digraph "th" to the voiceless dental fricative phoneme /θ/, as seen in words like "think" pronounced as /θɪŋk/. This approach enables accurate phonological parsing by treating orthographic digraphs—such as those briefly referenced from linguistic conventions—as unified units rather than separate letters.
Unicode normalization standards further facilitate digraph handling in text processing by ensuring consistent representation of equivalent forms. Under Normalization Form Compatibility Decomposition (NFD), the precomposed ligature "æ" (U+00E6) decomposes into the digraph "ae" (U+0061 followed by U+0065), allowing for uniform string comparisons and searches. Conversely, Normalization Form Compatibility Composition (NFC) recomposes "ae" back into "æ" where defined, preserving canonical equivalence in applications like database indexing and cross-platform text rendering. This mechanism is essential for multilingual software to manage ligatures and digraphs without loss of phonetic or semantic intent.[56]
Spell-checkers like Hunspell treat digraphs as indivisible units in languages with distinct phonemic representations, enhancing accuracy for non-English scripts. In Welsh, Hunspell's dictionary configuration recognizes "ll" as a single lateral fricative phoneme /ɬ/, using affix rules and word lists to validate mutations and compounds without splitting the pair, as implemented in updated versions for LibreOffice and Mozilla applications. This unit-based approach prevents false errors in words like "llan" (enclosure), supporting morphological analysis in resource-constrained languages.[57][58]
Search engines employ digraph-based stemming and similarity measures to improve query matching, particularly for English, by generating pair-wise letter n-grams or bigrams. These bigrams, such as "in" or "th" from query terms, enable fuzzy retrieval of variants like misspellings or inflections, boosting relevance in information retrieval systems. For example, bigram indexing expands search results for partial matches, reducing the impact of exact-word failures in large corpora.[59]
In natural language processing, bigram models conceptualize digraphs as character-level 2-grams to estimate transition probabilities, foundational for tasks like text generation and error correction. A bigram probability is computed as P(c_2 | c_1) = \frac{\text{count}(c_1 c_2)}{\text{count}(c_1)}, where c_1 and c_2 are consecutive characters, capturing dependencies such as the likelihood of "h" following "t" in English. This probabilistic framework, introduced in early statistical NLP, underpins language models by modeling local sequences without full context.[60]
Digraphs have informed keyboard layouts for non-Latin scripts since the 1990s, optimizing input for languages with multigraph conventions, while modern machine translation systems integrate them for phoneme mapping via grapheme-to-phoneme (G2P) conversion. In G2P pipelines, digraphs like Welsh "ll" or English "ch" are mapped to target phonemes during transliteration, aiding speech synthesis and cross-lingual alignment in neural models.[61]