public String compress(String message){
        initDictionary();
        String ret = "";
        for(int i = 0 ; i < message.length();i++){
            int j = i;
            int temp = -1;
            boolean found = true;
            String subject = new String();
            for( ;j < message.length(); j++){
                found = false;
                subject = message.substring(i,j+1);
                for(int k = 0 ; k < dictionary.size(); k++){
                    if(subject.equals(dictionary.get(k))){
                        temp = k;
                        found = true;
                        break;
                    }
                }
                if(!found)break;
            }
            if(!found)
                dictionary.add(subject);
            ret += String.valueOf(temp) + ",";
            i = j-1;
        }
        return ret.substring(0, ret.length()-1);
    }