public void toBMES(String file,int duplicateNum) throws IOException {
		BufferedWriter bout = new BufferedWriter(new OutputStreamWriter(
				new FileOutputStream(file,true), "UTF-8"));
		for(String line:set){
			if(line.length()>1){
				StringBuilder sb = new StringBuilder();
				for(int i=0;i<duplicateNum;i++){
					sb.append(line);
					if(i<duplicateNum-1)
						sb.append(" ");
				}
				line = sb.toString();
			}
			String s = Tags.genSegSequence(line,"\\s+",4);
			bout.write(s);
		}
		bout.close();	
	}
public void toBMES ( String file , int duplicateNum ) throws IOException { BufferedWriter bout = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( file , true ) , "UTF-8" ) ) ; for ( String line : set ) { if ( line . length ( ) > 1 ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < duplicateNum ; i ++ ) { sb . append ( line ) ; if ( i < duplicateNum - 1 ) sb . append ( " " ) ; } line = sb . toString ( ) ; } String s = Tags . genSegSequence ( line , "\\s+" , 4 ) ; bout . write ( s ) ; } bout . close ( ) ; }
将字典专为BMES标签
@param file
@throws IOException