Anonymous user
Textonyms: Difference between revisions
m
→{{header|REXX}}: split a long statement into two lines, added/changed whitespace, added a blank line to the output.
m (added related tasks.) |
m (→{{header|REXX}}: split a long statement into two lines, added/changed whitespace, added a blank line to the output.) |
||
Line 2,366:
do while lines(iFID)\==0; x= linein(iFID) /*keep reading the file until exhausted*/
y= x;
if \datatype(x, 'U') then do; ills= ills + 1; iterate; end
if $.x==. then do; dups= dups + 1; iterate; end
$.x= . /*indicate that it's a righteous word. */
#word= #word + 1 /*bump the word count (for the file). */
Line 2,375:
!.z= !.z y; _= words(!.z) /*build list of equivalent digit key(s)*/
if _>most then do; mostus= z; most= _; end
if @.z==2 then do; #= # + 1 /*bump the count of the textonyms. */
Line 2,387:
if @.z==1 then digKey= digKey + 1 /*bump the count of digit key words. */
end /*while*/
@dict= 'in the dictionary file'
L= length(commas(max(#word,ills,dups,digKey,#))) /*find length of max # being displayed.*/
say 'The dictionary file being used is: ' iFID
say
call tell #word, 'words' @dict "which can be represented by digit key mapping"▼
if dups>0 then call tell dups, 'duplicate word's(dups) "detected" @dict▼
if ills>0 then call tell ills, 'word's(ills) "that contain illegal characters" @dict
▲if dups>0 then call tell dups, 'duplicate word's(dups) "detected" @dict
call tell digKey, 'combination's(digKey) "required to represent them"
call tell #, 'digit combination's(#) "that can represent Textonyms"
say
if last
if long
if most \== 0 then say ' numerous digit key=' !.mostus " ("most 'words)'
exit # /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
Line 2,408 ⟶ 2,412:
<pre>
The dictionary file being used is: UNIXDICT.TXT
There are 24,978 words in the dictionary file which can be represented by digit key mapping.
There are 126 words that contain illegal characters in the dictionary file.
Line 2,422 ⟶ 2,427:
<pre>
The dictionary file being used is: TEXTONYMS.TXT
There are 12,990 words in the dictionary file which can be represented by digit key mapping.
There are 95 duplicate words detected in the dictionary file.
|