comparison doc/interpreter/doccheck/add_to_aspell_dict @ 10795:0306e572c686

Use case insensitive sort in spellcheck scripts.
author Rik <octave@nomad.inbox5.com>
date Sun, 18 Jul 2010 22:10:13 -0700
parents 3140cb7a05a1
children
comparison
equal deleted inserted replaced
10794:802d0fd0eaf0 10795:0306e572c686
18 } 18 }
19 19
20 $new_words_fname = shift(@ARGV); 20 $new_words_fname = shift(@ARGV);
21 if (!-r $new_words_fname) 21 if (!-r $new_words_fname)
22 { 22 {
23 die "Unable to read input file: $new_words_fname\n"; 23 die "Unable to read input file: $new_words_fname\n";
24 } 24 }
25 25
26 ################################################################################ 26 ################################################################################
27 # Add new words to a dictionary database 27 # Add new words to a dictionary database
28 open (FH, "<$new_words_fname") or die "Unable to open file: $new_words_fname\n"; 28 open (FH, "<$new_words_fname") or die "Unable to open file: $new_words_fname\n";
37 37
38 # Remove old dictionary file and write out new one 38 # Remove old dictionary file and write out new one
39 unlink ($octdict_fname) or die "Unable to delete Octave dictionary: $octdict_fname\n"; 39 unlink ($octdict_fname) or die "Unable to delete Octave dictionary: $octdict_fname\n";
40 open (FH, ">$octdict_fname") or die "Unable to open file for writing: $octdict_fname\n"; 40 open (FH, ">$octdict_fname") or die "Unable to open file for writing: $octdict_fname\n";
41 print FH $header; 41 print FH $header;
42 print FH sort keys(%dict_db); 42 print FH sort { uc($a) cmp uc ($b) } keys(%dict_db);
43 close (FH); 43 close (FH);
44 44