예제 #1
0
 public static UserData scanJpwords() {
   UserData userdata = new UserData();
   File vocdir = new File(config.getJptermsBaseDir());
   if (!vocdir.exists() || !vocdir.isDirectory()) {
     return userdata;
   }
   String[] words = vocdir.list();
   Utils.log.debug("total " + words.length + " words in termsbasedir.");
   for (int i = 0; i < words.length; i++) {
     userdata.addNewTerm(JpTerm.fromDisk(config.getJptermsBaseDir(), words[i]));
   }
   return userdata;
 }
예제 #2
0
 public static UserData searchJpwords() {
   UserData userdata = new UserData();
   String[] jpwordsDirs = config.getJpwordsDirs();
   for (int i = 0; i < jpwordsDirs.length; i++) {
     File vocdir = new File(jpwordsDirs[i]);
     if (!vocdir.exists() || !vocdir.isDirectory()) {
       continue;
     }
     File[] mp3files = FsUtils.findMp3WaveFiles(vocdir.getPath());
     for (int j = 0; j < mp3files.length; j++) {
       userdata.addNewTerm(JpTerm.createByMp3(config.getJptermsBaseDir(), mp3files[j]));
     }
   }
   return userdata;
 }