(classification of stars based upon spectral features)
A star's spectral type, indicated by its spectral class letter-code
with a single-digit appended (e.g., "G2"), is a classification based
upon the star's spectral features, the classes and specific types
organized by the temperatures associated with the associated
set of features.
Ten such types for each class are commonly used, 0 (hottest)
through 9 (coolest), except class O in which
O2 is the hottest spectral type in common use.
The difference between adjacent types (e.g., M5 and M6) is that
particular spectral features indicated by the class are more or
less prominent, reflecting some difference in temperature.
Fractional types are sometimes used, e.g., O9.5,
to further distinguish the spectrum.
Commonly the spectral type is cited with a following Roman numeral
(optionally appended) and sometimes with a further suffix.
For example, the Sun's type is often listed as "G2V"
and Barnard's Star as "M4 Ve".
The Roman numeral indicates a
luminosity class, which indicates the general size of the star
(e.g., main sequence versus giant).
Prefixes to the spectral type are also used in some cases.
Two such prefixes:
With some prefixes, the rest of the spectral type code is
specific to that type of star e.g., for white dwarf's spectral
types sometimes match the scheme described here, but also has its
own white-dwarf-specific types.
Suffixes b, ab, a, or a+ after the luminosity
class "I" indicate the star as exceptionally luminous, used
for supergiants and above. Other luminosity classes may
also be given an a or b suffix, e.g., "A0 Va" for
Vega, I presume to indicate more luminosity than usual.
Other suffixes indicate unusual spectra (termed peculiar),
generally appended to the luminosity class. Some of them:
p - general "peculiar" indicator, taken to modify the preceding suffix letter code if there is one, otherwise, unspecified.
Li - A chemical symbol (such as Li for lithium) indicates presence lines of that element, but I'm not sure whether emission or absorption is presumed. Example: "K5 IV(e)Li".
v - spectrum varies (over time), indicates the preceding suffix letter, if there is one. Note that variable stars have their own separate variable star classification covering the many types of variability.
A colon before the suffix indicates uncertainty, e.g., "G5V:e" for T Tauri.
More such suffix codes appear in tables listing stars. I've developed
the opinion that codes are sometimes coined for specific tables or lists
of stars, and that sometimes such a "coined spectral type code" is
later cited for the star with no explanation of the code.