private void loadDir(File f, WordTree parent,int depth) {
		WordTree current;
		if(parent.depth>=depth)
			current = parent;
		else{

			current= new WordTree();
			parent.childs.add(current);
			current.depth = parent.depth+1;
			current.tag=f.getName().replace(".dic", "");
		}
		if(f.isDirectory()){
			File[] flist = f.listFiles(new FilenameFilter(){

				public boolean accept(File dir, String name) {
					if(name.endsWith(".dic"))
						return true;
					else
						return false;
				}

			});
			for(int i=0;i<flist.length;i++)
				loadDir(flist[i],current,depth);
		}else{

			if(!f.toString().endsWith(".dic"))
				return;
			try {		
				InputStreamReader  read = new InputStreamReader 
				(new FileInputStream(f.toString()),"utf-8");
				BufferedReader bin = new BufferedReader(read);
				String w;
				while((w=bin.readLine())!=null){
					current.wordSet.add(w.trim());
				}
			}catch(Exception e){

			}
		}


	}
private void loadDir ( File f , WordTree parent , int depth ) { WordTree current ; if ( parent . depth >= depth ) current = parent ; else { current = new WordTree ( ) ; parent . childs . add ( current ) ; current . depth = parent . depth + 1 ; current . tag = f . getName ( ) . replace ( ".dic" , "" ) ; } if ( f . isDirectory ( ) ) { File [ ] flist = f . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { if ( name . endsWith ( ".dic" ) ) return true ; else return false ; } } ) ; for ( int i = 0 ; i < flist . length ; i ++ ) loadDir ( flist [ i ] , current , depth ) ; } else { if ( ! f . toString ( ) . endsWith ( ".dic" ) ) return ; try { InputStreamReader read = new InputStreamReader ( new FileInputStream ( f . toString ( ) ) , "utf-8" ) ; BufferedReader bin = new BufferedReader ( read ) ; String w ; while ( ( w = bin . readLine ( ) ) != null ) { current . wordSet . add ( w . trim ( ) ) ; } } catch ( Exception e ) { } } }
@param dicts
@param file