

|
|
DP_AlphaWords CFML Custom TagDownload | Revision History |Usage | Example Output | Resources The DP_AlphaWords Custom Tag provides a simple method for converting arbitrary text to list of words which help to disambiguate spelling. For example the word "CAT" may be translated to "Charlie Alfa Tango". This translation is useful when communicating information where spelling is crucial (computer passwords, names, license plate numbers, etc) over the phone or radio. It may also be useful when presenting potentially ambigious information such as randomly generated user names or passwords.
The tag supports the following alphabets:
|
| Input | Required. The string to be converted. |
| OutputVar | Option (defaults to "AlphaConversion"). The name of the variable to be used for outputing the results of the conversion. |
| AlphaSet | Optional (defaults to NATO). The alphabet set to use in the conversion. Acceptable values are "NATO", "LAPD", "Army1916", "Army1939", "Army1944", "RAF1924", "RAF1942", "RAF1943", "Gorey" or "Grover". |
| OutputStyle | Optional (defaults to Simple). Determines the style of output. Acceptable values are:
|
| OutputPrefix | Optional (defaults to an empty string). This string will be prefixed (inserted before) to the translation of each character. This argument is ignored if the OutputStyle is "Array". |
| OutputPostfix | Optional (defaults to a single space). This string will be postfixed (inserted after) to the translation of each character. This argument is ignored if the OutputStyle is "Array". |
| OutputIncludeCSS | Optional (defaults to false). If true the output will be tagged with CSS identifiers (using span tags) which the developer can set. These declarations are "dpAlphaWords_Char" (applied to the character in Verbose-style output) and "dpAlphaWords_Trans" (applied to the translation). Note that for long inputs including CSS can dramtically increase the size of the output. |
The tag outputs the variable defined with the "OutputVar" parameter. The content of the variable depends upon the valiu of the "OutputStyle" parameter.
The following example converts the string "qle1h50hO" (which contains some ambiguous characters) to a simple NATO alpha conversion:
<CFModule Template = "DP_AlphaWords.cfm"
AlphaSet = "NATO"
Input = "qle1h50ho"
OutputVar = "AlphaConversion"
OutputStyle = "Simple">
If case were important to the application you might use the "Verbose" output type as in the following call. Note that we use the "OutputPostfix" parameter to insert an HTML break at the end of each line of output:
<CFModule Template = "DP_AlphaWords.cfm"
AlphaSet = "NATO"
Input="qle1h50ho"
OutputVar="AlphaConversion"
OutputStyle="Verbose"
OutputPostfix = "<br>">
"Verbose" is especially good for phone applications as it produces a "script"-like output that's very easy to read.
Example Tag Output
back to top
Asking for "qle1h50ho" in simple NATO conversion returns the following in the "AlphaConversion" variable:
"Quebec Lima Echo One Hotel Five Zero Hotel Oscar"
The same string using the "Verbose" setting would returns the following in the "AlphaConversion" variable:
Lowercase "q" as in Quebec
Lowercase "l" as in Lima
Lowercase "e" as in Echo
The Number One
Lowercase "h" as in Hotel
The Number Five
The Number Zero
Lowercase "h" as in Hotel
Uppercase "O" as in Oscar
Other Resources
back to top
Other resources to help you make the most of this component including code walkthroughs and supporting systems and external web links.