import java.io.*; import java.util.*; public class Pakkija { public static void main(String args[]) throws IOException { StringBuffer sona = new StringBuffer(), pakitet = new StringBuffer(); HashMap map = new HashMap(); int wcount=0; BufferedReader sisse=new BufferedReader( new FileReader("failike.txt") ); String rida=sisse.readLine(); while(rida!=null){ //System.out.println(rida); for(int n=0; n < rida.length(); n++){ if( isAZaz( rida.charAt(n) ) ){ sona.append( rida.charAt(n) ); }else { if( sona.length() > 0 ){ System.out.println(""+sona); String str = new String(sona.toString()); if( !map.containsKey( str ) ){ map.put( (Object)("" + str), ((Object) new Integer(++wcount)) ); } pakitet.append( ((Integer)map.get(str)).toString() ); sona.delete(0, sona.length()); } pakitet.append(rida.charAt(n)); } } pakitet.append("\r\n"); rida=sisse.readLine(); } sisse.close(); //System.out.println(""+map+"\n"+pakitet); Object[] kamm = map.entrySet().toArray(); PrintWriter valja=new PrintWriter(new FileWriter("pakitet.txt")); for(int n=0; n='a')&&(c<='z')) || ((c>='A')&&(c<='Z')) ); } }