Bug that prevented reading txt wordlists. Added csv wordlists.
[sgc2.git] / praat_module / praatscript2cprogram.pl
blobf8e553062e16e78b0345e244ab4068551caaeb7c
1 #!/usr/bin/perl
3 # Convert an expanded praat script into a single string
4 # Output a stand alone Praat main program
6 # Use:
7 # perl praatscript2cprogram.pl script.praat > demoapplication.h
8 #
9 print <<'ENDOFHEADER';
10 /* C const char string with Praat script
11 * Generated automatically
12 * For license, see Praat script text
16 static char32_t myDemoScript [] = U""
17 ENDOFHEADER
18 while(<>){
19 # Protect special characters
20 s/\\/\\\\/g;
21 s/[\n\r\l]/\\n/g;
22 s/\"/\\"/g;
23 print "\"$_\"\n";
25 print <<'ENDOFFOOTER';
28 ENDOFFOOTER