| @@ -0,0 +1,66 @@ |
| 1 | +#!/bin/sh |
| 2 | +########################################################################### |
| 3 | +## ## |
| 4 | +## Language Technologies Institute ## |
| 5 | +## Carnegie Mellon University ## |
| 6 | +## Copyright (c) 2017 ## |
| 7 | +## All Rights Reserved. ## |
| 8 | +## ## |
| 9 | +## Permission is hereby granted, free of charge, to use and distribute ## |
| 10 | +## this software and its documentation without restriction, including ## |
| 11 | +## without limitation the rights to use, copy, modify, merge, publish, ## |
| 12 | +## distribute, sublicense, and/or sell copies of this work, and to ## |
| 13 | +## permit persons to whom this work is furnished to do so, subject to ## |
| 14 | +## the following conditions: ## |
| 15 | +## 1. The code must retain the above copyright notice, this list of ## |
| 16 | +## conditions and the following disclaimer. ## |
| 17 | +## 2. Any modifications must be clearly marked as such. ## |
| 18 | +## 3. Original authors' names are not deleted. ## |
| 19 | +## 4. The authors' names are not used to endorse or promote products ## |
| 20 | +## derived from this software without specific prior written ## |
| 21 | +## permission. ## |
| 22 | +## ## |
| 23 | +## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ## |
| 24 | +## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ## |
| 25 | +## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ## |
| 26 | +## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ## |
| 27 | +## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ## |
| 28 | +## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ## |
| 29 | +## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ## |
| 30 | +## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ## |
| 31 | +## THIS SOFTWARE. ## |
| 32 | +## ## |
| 33 | +########################################################################### |
| 34 | +## ## |
| 35 | +## Make feats for a voice so that they are in the linked in version ## |
| 36 | +## ## |
| 37 | +## $FLITEDIR/tools/make_flite_feats ../etc/voice.feats >VOICENAME_voice_feats.c ## |
| 38 | +## ## |
| 39 | +## ../etc/voice.feats should look something like ## |
| 40 | +## ## |
| 41 | +## age 42 ## |
| 42 | +## gender male ## |
| 43 | +## variant Scots ## |
| 44 | +## ## |
| 45 | +## If ./COPYING exists, the content is added as the feature copyright ## |
| 46 | +## ## |
| 47 | +########################################################################### |
| 48 | + |
| 49 | +export LANG=C |
| 50 | + |
| 51 | +awk '{if (NF > 1) print $0}' $1 | sed 's/"/\\"/g' | |
| 52 | +awk '{printf("flite_feat_set_string(vox->features,\"%s\",\"",$1); |
| 53 | + for (i=2; i<NF; i++) |
| 54 | + printf("%s ",$i); |
| 55 | + printf("%s\");\n",$NF);}' |
| 56 | + |
| 57 | +if [ -f COPYING ] |
| 58 | +then |
| 59 | + cat COPYING | sed 's/"/\\"/g' | |
| 60 | + awk 'BEGIN {printf("flite_feat_set_string(vox->features,\"copyright\",\" \\n\"\n");} |
| 61 | + { printf("\"%s\\n\"\n",$0); } |
| 62 | + END {printf(");\n");}' |
| 63 | +fi |
| 64 | + |
| 65 | +exit |
| 66 | + |