public static void processTriple(String subject, String verb, String object, String inputDir, String outDir){
         
         //expansion
         ArrayList<String> subject_words = expanded_object_list.get(subject);
         ArrayList<String> verb_words = expanded_verb_list.get(verb);
         ArrayList<String> object_words = expanded_object_list.get(object);
         
         
         try{
            File output_file_subject_verb = new File(outDir+"/subject_verb.txt");
            FileWriter fstream_subject_verb = new FileWriter(output_file_subject_verb);
            BufferedWriter out_subject_verb = new BufferedWriter(fstream_subject_verb); 
            
            File output_file_object_verb = new File(outDir+"/object_verb.txt");
            FileWriter fstream_object_verb = new FileWriter(output_file_object_verb);
            BufferedWriter out_object_verb = new BufferedWriter(fstream_object_verb); 
            
            File output_file_verb_subject = new File(outDir+"/verb_subject.txt");
            FileWriter fstream_verb_subject = new FileWriter(output_file_verb_subject);
            BufferedWriter out_verb_subject = new BufferedWriter(fstream_verb_subject); 
            
            File output_file_verb_object = new File(outDir+"/verb_object.txt");
            FileWriter fstream_verb_object = new FileWriter(output_file_verb_object);
            BufferedWriter out_verb_object = new BufferedWriter(fstream_verb_object); 
            
            File dir = new File(inputDir);
            File[] files = dir.listFiles();
            
            for (int i = 0 ; i<files.length;i++){
                
                System.out.println("file name" + files[i].getName());
                FileInputStream fis = new FileInputStream(files[i]);
                BufferedInputStream bis = new BufferedInputStream(fis);
                DataInputStream dis = new DataInputStream(bis);
                while (dis.available() != 0) {
                    String line = dis.readLine();
                    //System.out.println("line" + line);
                    String pattern = "[\\s]+";
                    Pattern splitter = Pattern.compile(pattern);
                    String[] words = splitter.split(line);
                    
                    String first = words[0];
                    String second = words[1];
                    String last = words[words.length-2];
                    //System.out.println(" first " + first  + " last "+ last);
                    
                    if ((subject_words.contains(first) || subject_words.contains(second)) && verb_words.contains(last)){
                        subject_verb.add(line);
                        out_subject_verb.write(line+"\n");
                    }
                 /*   if ((object_words.contains(first) || object_words.contains(second)) && verb_words.contains(last)){
                        object_verb.add(line);
                        out_object_verb.write(line+"\n");
                    }
                    if (verb_words.contains(first) && subject_words.contains(last)){
                        ArrayList<String> value = verb_subject.get(first);
                        if (value == null) value = new ArrayList<String>();
                        value.add(line);
                        verb_subject.put(first, value);
                        out_verb_subject.write(line+"\n");
                    }*/
                    if (verb_words.contains(first) && object_words.contains(last)){
                        ArrayList<String> value = verb_object.get(first);
                        if (value == null) value = new ArrayList<String>();
                        value.add(line);
                        verb_object.put(first, value);
                        out_verb_object.write(line+"\n");
                    }
                    
                    
                }
            }
            
            out_subject_verb.close();
            out_object_verb.close();
            out_verb_subject.close();
            out_verb_object.close();
            
        }catch(Exception e){System.out.println("exception" +e);}
         
         
         
         
         
     }