From: Curt M. <we...@us...> - 2002-11-24 06:11:21
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs1:/tmp/cvs-serv1804 Modified Files: util.c Log Message: Tweaks to the speech stuff so that we don't add commas to the SSID portion of a callsign. This makes it speak -12 as "dash twelve". Index: util.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/util.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** util.c 23 Nov 2002 16:18:20 -0000 1.43 --- util.c 24 Nov 2002 06:11:18 -0000 1.44 *************** *** 2560,2568 **** ! // Function which adds commas to callsigns (and other abbreviations) // in order to make the text sound better when run through a Text-to- // Speech system. We try to change only normal amateur callsigns. // If we find a number in the text before a dash is found, we ! // consider it to be a normal callsign. void spell_it_out(char *text) { char buffer[2000]; --- 2560,2569 ---- ! // Function which adds commas to callsigns (and other abbreviations?) // in order to make the text sound better when run through a Text-to- // Speech system. We try to change only normal amateur callsigns. // If we find a number in the text before a dash is found, we ! // consider it to be a normal callsign. We don't add commas to the ! // SSID portion of a call. void spell_it_out(char *text) { char buffer[2000]; *************** *** 2573,2585 **** while (text[i] != '\0') { if (text[i] == '-') dash_found++; if (is_num_chr(text[i]) && !dash_found) number_found_before_dash++; buffer[j++] = text[i]; ! buffer[j++] = ','; i++; } buffer[j] = '\0'; if (number_found_before_dash) strcpy(text,buffer); --- 2574,2594 ---- while (text[i] != '\0') { + if (text[i] == '-') dash_found++; + if (is_num_chr(text[i]) && !dash_found) number_found_before_dash++; + buffer[j++] = text[i]; ! ! if (!dash_found) // Don't add commas to SSID ! buffer[j++] = ','; ! i++; } buffer[j] = '\0'; + + // Only use the new string if it kind'a looks like a callsign if (number_found_before_dash) strcpy(text,buffer); |