public static void main(String[] args) throws FileNotFoundException, IOException {
		IndexReader reader=new IndexReader();
		Map<String,Integer> stopWords = new HashMap<String,Integer>();

//		String[] keywords={"Study","English","US"};
		reader.wordmap.setupLexicon("result/lexicon_index.txt");
////		System.out.println(wordmap.lexiconMap.size());
		reader.wordmap.setupUrl("result/url_index.txt");
//		reader.result=reader.query(keywords);
		int resultSize=10;
		String[] result=new String[resultSize];
			    
		BufferedReader in = null;
		int value=1;
		try {
			in = new BufferedReader(new FileReader("stopWords.txt"));
			String line;
			while ((line = in.readLine()) != null) 
			{
				stopWords.put(line, value);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		finally{in.close();}
		
		//end set up stop words
		
		//interface
		while(true)
		{
			System.out.print("Please input the query:");
			try{
				//get console input
			    BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
			    String input = bufferRead.readLine();
			    System.out.println(input);
			    String[] tempWord = input.split(" ");
//			    List<String> tempWordList = new ArrayList<String>();
//			    for(int i=0; i<tempWord.length;i++)
//			    {
//			    	if(stopWords.containsKey(tempWord[i])!=true)
//			    	{
//			    		tempWordList.add(tempWord[i]);
//			    	}
//			    		
//			    }
//			    String [] keywords = new String[tempWordList.size()];
//			    for(int i=0; i<tempWordList.size(); i++)
//			    {
//			    	keywords[i] = (String) tempWordList.get(i);
//			    }
			    
				result=reader.query(tempWord,10,resultSize);//(originalWords, pruneSize, resultSize)
				for (int i=0;i<10;i++){System.out.println(result[i]);}
				System.out.println();
                //finish
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}
		}

	}