voxforge.org
VoxForge Dev

Changeset 2351

Show
Ignore:
Timestamp:
11/14/07 21:57:07 (9 months ago)
Author:
kmaclean
Message:

Localization code for SpeechSubmission applet: added Dutch prompts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java

    r2350 r2351  
    6666import speechrecorder.Prompts; 
    6767import speechrecorder.LabelLocalizer; 
    68 import java.util.regex.Matcher; 
    69 import java.util.regex.Pattern; 
    70 // !!!!!! 
     68 
    7169 
    7270/** 
     
    7876 
    7977    final int bufSize = 16384; 
    80 // !!!!!! 
    8178    public static int BUFFER_SIZE = 10240; 
    8279    public static final String fileType = "wav";      
    83     public static final int samplingRate = 48000; 
    84 //    public static final int samplingRate = 44100;  // jre 1.4.2 only supports max of 44100 
     80    public static final int samplingRate = 48000;// jre 1.4.2 only supports max of 44100 
    8581    public static final int samplingRateFormat = 16;       
    8682    public static final int numberChannels = 1;       
     
    104100    AudioFormat format = new AudioFormat(samplingRate, samplingRateFormat, numberChannels, true, false); 
    105101 
    106 // !!!!!!     
    107102    Capture capture = new Capture(); 
    108103    Playback playback = new Playback(); 
     
    112107    AudioInputStream audioInputStream; 
    113108    SamplingGraph samplingGraph; 
    114  
     109// !!!!!! 
    115110    JButton playB; 
    116111    JButton captB; 
     
    364359 
    365360    if (prompt1 == null || prompt1.length() == 0) { 
    366         Prompts prompts = new Prompts(10); 
     361        Prompts prompts = new Prompts(10, "Dutch"); 
    367362        String [][] promptArray = prompts.getPrompts(); 
    368363                this.promptID1 = promptArray[0][0]; 
  • Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/Prompts.java

    r2324 r2351  
    55 
    66class Prompts  { 
    7     String [] DefaultpromptList = {  
     7        String [] promptList; 
     8    String [] englishPromptList = {  
    89     "rp-01 When the sunlight strikes raindrops in the air,", 
    910         "rp-02 they act as a prism and form a rainbow.", 
     
    12251226         "b0538 At the best, they were necessary accessories." , 
    12261227         "b0539 You were making them talk shop, Ruth charged him."  
    1227  
    12281228         }; 
     1229    String [] dutchPromptList = {  
     1230     "nl001 De aanbesteding die algemeen bekend wordt gemaakt", 
     1231     "nl002 Alle ondernemers mogen inschrijven.", 
     1232     "nl003 Nederlands is een prachtige taal.", 
     1233     "nl004 De bestuurlijke en de strafrechtelijke handhaving staan naast elkaar.", 
     1234     "nl005 Zij hebben elk een eigen functie.", 
     1235     "nl006 Wilt u contant betalen of pinnen?", 
     1236     "nl007 Die kennis is ook nodig op de terechtzitting.", 
     1237     "nl008 Waarom brengt het openbaar ministerie juist deze zaak aan.", 
     1238     "nl009 Waarom is juist deze straf nodig?", 
     1239     "nl010 Dat genre schilderijen vind ik mooi.", 
     1240     "nl011 Onze bijdrage was een druppel op een gloeiende plaat.", 
     1241     "nl012 Peter lijkt goed op dreef te zijn.", 
     1242     "nl013 Met deze circulaire is rekening gehouden.", 
     1243     "nl014 Er waren uiteenlopende standpunten.", 
     1244     "nl015 De storm heeft een enorme ravage aangericht.", 
     1245     "nl016 Hiermee is voldaan aan de wens van het bedrijfsleven.", 
     1246     "nl017 Er is geen bindende regeling tot stand gebracht", 
     1247     "nl018 Ik heb de opdracht aanvaard.", 
     1248     "nl019 Het oog van de meester maakt het paard vet.", 
     1249     "nl020 Er wordt al jaren gewerkt aan de harmonisatie van de methoden.", 
     1250     "nl021 Victor was in gepeins verzonken.", 
     1251     "nl022 Willem liegt altijd of het gedrukt staat.", 
     1252     "nl023 Dat geldt voor bepaalde buitenlandse instellingen", 
     1253     "nl024 Ze kwam geruisloos binnen.", 
     1254     "nl025 Alle instellingen in de intramurale gezondheidszorg,", 
     1255    }; 
    12291256    String [][] promptSubset;  
    12301257 
    1231 public Prompts(int NumberofPrompts) { 
     1258public Prompts(int NumberofPrompts, String Language) { 
     1259        if (Language == "English") { 
     1260                promptList = englishPromptList; 
     1261        } else if (Language == "Dutch") { 
     1262                promptList = dutchPromptList; 
     1263        } else { 
     1264                promptList = englishPromptList; 
     1265        } 
     1266         
    12321267        promptSubset = new String [2][NumberofPrompts]; 
    12331268     
    12341269        Random randomGenerator = new Random(); 
    1235         int arrayLength = DefaultpromptList.length - 1; 
     1270        int arrayLength = promptList.length - 1; 
    12361271        int nextPrompt = randomGenerator.nextInt(arrayLength); 
    12371272        for (int idx=0;idx<NumberofPrompts; idx++) { 
     
    12541289    StringBuffer prompt = new StringBuffer(); 
    12551290     
    1256         StringTokenizer st = new StringTokenizer(DefaultpromptList[nextPrompt]); 
     1291        StringTokenizer st = new StringTokenizer(promptList[nextPrompt]); 
    12571292    String [] words= new String [st.countTokens()]; 
    12581293        int i = 0;