Idiomatically determine all the characters that can be used for symbols: Difference between revisions

m
(jq)
Line 116:
 
Here, [http://www.jsoftware.com/help/dictionary/dadot.htm a.] is the set of chararacters we are testing. We prefix each of these with an arbitrary letter, and suffix each with an arbitrary character and then try counting how many parsed tokens are formed by the result. If the token count is 1, then that character was a legal word-forming character.
 
Of course, we also only need to do this once. Once we have a set of these characters, it's faster and easier to use a set membership test on the characters themselves than on the expression which generates them.
 
=={{header|Java}}==
6,962

edits