# How can I find English words among the names of the characters in the Mathematica character set?

I want to find some single meaningful words in the "ASCII/Unicode" form characters.

For example, I want to get alpha from \[Alpha].

\[Alpha] // FullForm

\[Alpha]


here there are two ways:

## method 1

Obtain all FullForm such characters list, and get the words, and check the validity/

{"\[Alpha]", "\[Function]", "\[Beta]"} // FullForm

List["\[Alpha]","\[Function]","\[Beta]"]

wordlist = StringCases[
ToString[FromCharacterCode[Range[0, 200]], CharacterEncoding -> "ASCII"],
Shortest["\\["~~x__~~"]"] /;(Length@DictionaryLookup[x, IgnoreCase -> True]
>= 1) -> x
]

{Cent,Sterling,Currency,Yen,Section,Micro,Paragraph}


The above code becomes too slow at Range is 20000, so how to speed up it, and extend the characters(some maybe not in FromCharacterCode[Range[0,65536]) such like "\[Function]" this is the question1 .

## method 2

I have a wordlist to check the validity.

For example, alpha, then convert it into the right string form.

we can check by ToExpression, the problem is ToExpression sometimes returns too many errors for some wrong string.

Something like a function SyntaxQ(which failed at such characters \[Function])

SyntaxQ["\\[Function]"]

False

wordlist = "\\["<>StringJoin[MapAt[ToUpperCase, Characters[#], 1]]<>"]" & /@
DictionaryLookup["*"];

Select[wordlist, SyntaxQ] // Union

{\[Alpha],\[Andy],\[Angle],\[Angstrom],\[Bet],\[Beta],\[Breve],\[Bullet],\[Cedilla],\[Cent
iameter],\[Earth],\[Ellipsis],\[Epsilon],\[Eta],\[Euro],\[Flat],\[Florin],\[Gamma],\[Hyphe
n],\[Infinity],\[Iota],\[Jupiter],\[Kappa],\[Lambda],\[Mars],\[Mercury],\[Micro],\[Moon],\
[Mu],\[Natural],\[Neptune],\[Nu],\[Null],\[Omega],\[Omicron],\[Paragraph],\[Phi],\[Pi],\[P
laceholder],\[Pluto],\[Prime],\[Psi],\[Rho],\[Rupee],\[Saturn],\[Section],\[Sharp],\[Sigma
\[Uranus],\[Venus],\[Villa],\[Wolf],\[Xi],\[Yen],\[Zeta]}

% // Length

73


So, I just found 73 words, that's too little.

I think/hope there is a list(maybe some files) for such "ASCII"/Special characters.

question2 is to set up from a wordlist I wanna to check.

## References

Of course we can import such help pages to get all such words, but I'd like some way like Names["*"] to get all such codes, that's much faster.

guide/SpecialCharacters

• You can consider that I want to count the vocabulary in the SpecialCharacters. Good Night. Hope not so bad to understand. Sep 10, 2013 at 15:29
• Sounds like you want the unicode names list: unicode.org/Public/UNIDATA/NamesList.txt Note that Mma doesn't support anything above FFFF. Sep 10, 2013 at 15:30
• @Szabolcs Yes, I think part of special characters are NameList of unicode, I'm not sure whether that's all the same in Mathematica, maybe some special characters are unique in Mathematica? Sep 10, 2013 at 15:31
• No, it's not the same. So what you want is precisely their Mathematica names? Sep 10, 2013 at 15:31
• @Mr.Wizard & m_goldberg: actually that seems to be the case. See here and here Sep 11, 2013 at 17:08

Building on an example from the documentation of FromCharacterCode,

c = Select[ToString[FullForm[FromCharacterCode[#]]] & /@ Range[65535],
StringMatchQ[#, "\"\\[" ~~ ___] &];
Length[c]
Grid@Sort[
Partition[Riffle[c, ToExpression[c]],
2] /. {a_, b_} :> {StringTake[a, {4, -3}], b}]


923

Partial output, in alphabetical order

Which of the special characters are English words (in lower case)?

DictionaryLookup /@ (%[[1, All, 1]] // ToLowerCase) // Flatten


{"alpha", "and", "angle", "angstrom", "backslash", "because", "bet", "beta", "breve", "bullet", "cap", "cedilla", "cent", "chi", "cloverleaf", "colon", "conditioned", "congruent", "conjugate", "continuation", "copyright", "cross", "cup", "curl", "currency", "dagger", "dash", "degree", "delta", "diameter", "diamond", "distributed", "divergence", "divide", "divides", "earth", "element", "ellipsis", "epsilon", "equal", "equilibrium", "equivalent", "eta", "euro", "exists", "flat", "florin", "formals", "function", "gamma", "gradient", "hyphen", "implies", "infinity", "integral", "intersection", "iota", "kappa", "lambda", "mars", "mercury", "micro", "minus", "moon", "mu", "natural", "nor", "not", "nu", "null", "omega", "omicron", "or", "paragraph", "perpendicular", "phi", "pi", "piecewise", "placeholder", "precedes", "prime", "product", "proportion", "proportional", "psi", "rho", "rule", "rupee", "scripts", "section", "sharp", "sigma", "spooky", "square", "star", "sterling", "stigma", "subset", "succeeds", "sum", "sun", "tau", "therefore", "theta", "thorn", "tilde", "times", "trademark", "transpose", "union", "upsilon", "villa", "wedge", "wolf", "xi", "yen", "zeta"}

Length[%]


117

Which of the special characters are English words (in upper case)?

DictionaryLookUp recognizes the following special characters in Upper case:

{"Andy", "Angstrom", "Chi", "Colon", "Cross", "Delta", "Jupiter", "Mars", "Mercury", "Moon", "Neptune", "Pluto", "Saturn", "Sharp", "Sterling", "Thorn", "Union", "Uranus", "Venus", "Villa", "Wolf"}

Of those it recognizes the following ONLY in uppercase: the name of a man and the names of the planets in our solar system.

{"Andy", "Jupiter", "Neptune", "Pluto", "Saturn", "Uranus", "Venus"}

• I wonder if the \[Andy] character has anything to do with @AndyRoss (easter egg?) Sep 10, 2013 at 19:47
• There's also \[Villa], \[Akuz], \[Spooky] Sep 10, 2013 at 23:22
• @Szabolcs I wonder why those characters didn't appear. Sep 11, 2013 at 0:13

Why not to open SystemFiles/FrontEnd/TextResources/UnicodeFontMapping.tr and import these characters and their codes?

The list of names can be loaded in the following way

Join @@ StringCases[#, "[" ~~ x__ ~~ "]" :> x] & @
Flatten @ Import @
FileNameJoin[{\$InstallationDirectory,
"/SystemFiles/FrontEnd/TextResources/UnicodeFontMapping.tr"}]


931 words

Here is the first part of David's answer in a more concise and efficient form:

StringCases[
ToString @ FullForm @ FromCharacterCode @ Range @ 65535,
a : ("\\[" ~~ Shortest[x__] ~~ "]") :> {x, ToExpression["\"" <> a <> "\""]}
] // Sort // Grid