gt: 		if(type == ORIGINAL){
context: 
  
  import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.DataInputStream;
  import java.io.FileInputStream;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  import java.util.Map.Entry;
  
  //import graphIndex.KSearchGraph;
  
  
  
  import org.xml.sax.helpers.DefaultHandler;
  import org.xml.sax.*;
  
  
  class edgeLabelUnitNoRoot{
  	int labelID;
  	double weight;
  	String labelName;
  	String labelValue;
  	boolean labelHave;
  	edgeLabelUnitNoRoot(){
  		labelHave = false;
  		weight = 1.0;
  	}
  };
  public class XMLHandlerNoRoot extends DefaultHandler{
  
  	private String folder = "data/dblp2_BigNoRoot";
  	private int ORIGINAL = 0;
  	private int CLEAN = 1;
  	private int CHECK = 2;
  	private String NODEFILE = folder+"nodes.txt";
  	private String EDGEFILE = folder+"edges.txt";
  	private String KEYWORDFILE = folder+"keywordID.txt";
  	private String EDGELABEL = folder+"edgelabel.txt";
  	private String EDGEINFO = folder+"edgeinfo.txt";
  	private String NODECLEANFILE = folder+"nodeclear.txt";
  	private String NODEFORCHECK = folder+"nodeforcheck.txt";
  	private String COMMONFILE = "data/common_words.txt";
  	private String ERRORF = folder+"error.txt";
  	private String NODENUM = folder+"nodenum.txt";
  	
  	private BufferedWriter outError = null;
  	
  	private BufferedWriter outNodeF = null;
  	private BufferedWriter outEdgeF = null;
  	private BufferedWriter outKeyIDF = null;
  	private BufferedWriter outEdgeLableF = null;
  	private BufferedWriter outEdgeInfoF = null;
  	private BufferedWriter outNodeCleanF = null;
  	private BufferedWriter outNodeNumF = null;
  	//check part
  	private BufferedWriter outNodeForCheck = null;
  	//end of check part
  	
  	private List<Object> qNameList = null;
  	
  	private HashMap<Object, Integer> keywordIDMap = null;
  	private HashMap<Object, edgeLabelUnitNoRoot> edgeLabelIDMap = null;
  	private HashMap<Object, HashMap<Object, Integer>> findNodeIDMap = null;
  	private List<Object> commonList = null;
  	//private int rootID = 0;
  	public int nodeID = 1;
  	public int edgeID = 1;
  	private int articleID = 1;
  	private int keywordID = 1;
  	private int edgeLableID = 1;
  	
  	
  	private final int SPLIT=1;
  	private final int NOTSPLIT=0;
  	
  	private String keyInArticle = "";
  	private List<edgeLabelUnitNoRoot> adjList = new ArrayList<edgeLabelUnitNoRoot>();
  	
  	public void startDocument() throws SAXException{
  		try {
  			outNodeF = openFile(NODEFILE);
  			outEdgeF = openFile(EDGEFILE);
  			outKeyIDF = openFile(KEYWORDFILE);
  			outEdgeLableF = openFile(EDGELABEL);
  			outEdgeInfoF = openFile(EDGEINFO);
  			outNodeCleanF = openFile(NODECLEANFILE);
  			outNodeForCheck = openFile(NODEFORCHECK);
  			outNodeNumF = openFile(NODENUM);
  			outError = openFile(ERRORF);
  			
  			commonList = CommonFunction.readCommonList(COMMONFILE);
  			
  			articleID = -1;
  			
  			qNameList = new ArrayList<Object>();
  
  			//test
  			String keyword[] = {"article","inproceedings","proceedings","book","incollection","phdthesis","mastersthesis","www"};
  			for(int i=0;i<keyword.length;i++)
  				qNameList.add(keyword[i].toLowerCase());
  			//end of test
  			
  			keywordIDMap = new HashMap<Object, Integer>();
  			edgeLabelIDMap = new HashMap<Object, edgeLabelUnitNoRoot>();
  			//nodeAdjacent = new TreeMap<Integer, String>(); 
  		} catch (IOException e) {
  			e.printStackTrace();
  		}
  	}
  	
  	/**
  	 * From keyword, remove useless symbols
  	 * @param inputStr
  	 * @return
  	 */
  	private String replaceSymbol(String inputStr){
  		return inputStr.replace(",", "").replace(".","").replace("'", "").replace("\"", "");
  	}
  
  	/**
  	 * Insert keyword to map
  	 * @param inputStr
  	 * @param split
  	 * @return
  	 */
  	public boolean insertKeywordMap(String inputStr, int split){
  		if(keywordIDMap==null)
  			keywordIDMap = new HashMap<Object, Integer>();
  		if(!inputStr.isEmpty()){
  			if(split==SPLIT){
  				String[] temp;
  				String delimiter = " ";
  				temp = inputStr.split(delimiter);
  				if(temp.length>1){
  					for(int i=0;i<temp.length;i++){
  						String tempStr = replaceSymbol(temp[i]);
  						if(!keywordIDMap.containsKey(tempStr)){
  							keywordIDMap.put(tempStr, keywordID);
  							try {
  								writeFile(outKeyIDF,keywordID+" "+tempStr);
  							} catch (IOException e1) {
  								// TODO Auto-generated catch block
  								e1.printStackTrace();
  							}
  							keywordID++;
  						}
  					}
  				}
  				else{
  					if(!keywordIDMap.containsKey(inputStr)){
  						keywordIDMap.put(inputStr, keywordID);
  						try {
  							writeFile(outKeyIDF,keywordID+" "+inputStr);
  						} catch (IOException e1) {
  							// TODO Auto-generated catch block
  							e1.printStackTrace();
  						}
  						keywordID++;
  					}
  				}
  			}
  			else if(split==NOTSPLIT){
  				String insertStr = inputStr;
  				String tempStr = insertStr;
  				if(!keywordIDMap.containsKey(tempStr)){
  					keywordIDMap.put(tempStr, keywordID);
  					try {
  						writeFile(outKeyIDF,keywordID+" "+tempStr);
  					} catch (IOException e1) {
  						// TODO Auto-generated catch block
  						e1.printStackTrace();
  					}
  					keywordID++;
  				}
  			}
  			return true;
  		}
  		return false;
  	}
  
  	void showFindNodeIDMap(){
  		if(findNodeIDMap == null)
  			System.out.println("empty!!!");
  		else{
  			Iterator<Entry<Object,HashMap<Object, Integer>>> iter = findNodeIDMap.entrySet().iterator();
  			while(iter.hasNext()){
  				  @SuppressWarnings("rawtypes")
  				  Map.Entry entryBMap = (Map.Entry) iter.next(); 
  				  String srcMap = (String) entryBMap.getKey();
  				  HashMap<Object, Integer> listMap = findNodeIDMap.get(srcMap);
  				  Iterator<Entry<Object,Integer>> iterSecond = listMap.entrySet().iterator();
  				  System.out.print(srcMap+":");
  				  while(iterSecond.hasNext()){
  					  @SuppressWarnings("rawtypes")
  					  Map.Entry entryBMapSecond = (Map.Entry) iterSecond.next();
  					  String keyStr = (String) entryBMapSecond.getKey();
  					  int id = listMap.get(keyStr);
  					  System.out.print("("+keyStr+","+id+")");
  				  }
  				  System.out.println("");
  			}
  		}
  	}
  	/**
  	 * Insert element to findNodeIDMap
  	 * @param mapStr
  	 * @param inputStr
  	 * @return false if this sting in the corresponding map already, else true
  	 * @throws IOException
  	 */
  	boolean insertFindNodeIDMap(String mapStr, String inputStr) throws IOException{
  		if(findNodeIDMap == null)
  			findNodeIDMap = new HashMap<Object,HashMap<Object, Integer>>();
  		HashMap<Object,Integer> nodeIDMap = findNodeIDMap.get(mapStr);
  		if(nodeIDMap != null){
  			if(nodeIDMap.containsKey(inputStr)){
  				return false;
  			}
  			else{
  				nodeIDMap.put(inputStr, nodeID);
  			}
  		}
  		else{
  			nodeIDMap = new HashMap<Object, Integer>();
  			nodeIDMap.put(inputStr, nodeID);
  			findNodeIDMap.put(mapStr, nodeIDMap);
  		}
  		return true;
  	}
  	
  	/**
  	 * Check map contains element or not
  	 * @param mapStr
  	 * @param inputStr
  	 * @return
  	 */
  	boolean findNodeMapContain(String mapStr, String inputStr){
  		if(findNodeIDMap == null)
  			return false;
  		//String insertStr = replaceSymbol(inputStr);
  		HashMap<Object,Integer> nodeIDMap = findNodeIDMap.get(mapStr);
  		if(nodeIDMap != null){
  			if(nodeIDMap.containsKey(inputStr)){
  				return true;
  			}
  		}
  		return false;	
  	}
  	
  	/**
  	 * Get node id from findNodeMap
  	 * @param mapStr
  	 * @param inputStr
  	 * @return -1 if can not find
  	 */
  	int getIDFormFindNodeMap(String mapStr, String inputStr){
  		//String insertStr = replaceSymbol(inputStr);
  		if(findNodeMapContain(mapStr,inputStr))
  			return findNodeIDMap.get(mapStr).get(inputStr);
  		return -1;	
  	}
  	
  	/**
  	 * Function to generate keyword list(STRING) for check file
  	 * @param keywordStr
  	 * @param split
  	 * @param check
  	 * @return
  	 */
  	public String generateNode2Keyword(String keywordStr, int split, int type){
  		String retStr = null;
  