Ejemplo n.º 1
0
 public List<JpTerm> getWordList(int level) {
   List<JpTerm> terms = new ArrayList<JpTerm>();
   if (wordList != null) {
     Date now = new Date();
     for (Iterator<JpTerm> iterator = wordList.iterator(); iterator.hasNext(); ) {
       JpTerm t = iterator.next();
       if (t.info != null
           && /* t.info.shouldReview(now) &&*/ t.keyvoice != null
           && !t.expl().equals("")
           && t.info.level == level) terms.add(t);
     }
   }
   return terms;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
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;
 }