public static double getSimilarity(String fileName1, String fileName2)throws IOException
	{
		double score=0;
		HashMap<String, Double> weightmap1 = new HashMap<String, Double>();
		HashMap<String, Double> weightmap2 = new HashMap<String, Double>();
		ArrayList<String> lines=new ArrayList();
		
		try{
			InputStream ips=new FileInputStream(fileName1); 
			InputStreamReader ipsr=new InputStreamReader(ips);
			BufferedReader br=new BufferedReader(ipsr);
			String ligne;
			while ((ligne=br.readLine())!=null){
				lines.add(ligne);
			}
			br.close(); 
		}		
		catch (Exception e){
			System.out.println(e.toString());
		}
		ArrayList<String> mots=new ArrayList();
		Double wikc=0.0;
		for (String ligne:lines){
			String mot=ligne.split("\t")[0];
			mots.add(mot);
			Double wik=Double.parseDouble(ligne.split("\t")[1]);
			weightmap1.put(mot,wik);
			wikc+=Math.pow(wik,2);
		}
		Double r1=Math.sqrt(wikc);
		lines.clear();
		try{
			InputStream ips=new FileInputStream(fileName2); 
			InputStreamReader ipsr=new InputStreamReader(ips);
			BufferedReader br=new BufferedReader(ipsr);
			String ligne;
			while ((ligne=br.readLine())!=null){
				lines.add(ligne);
			}
			br.close(); 
		}		
		catch (Exception e){
			System.out.println(e.toString());
		}
		Double wjkc=0.0;
		Double sumwijk=0.0;
		for (String ligne:lines){
			Double wjk=Double.parseDouble(ligne.split("\t")[1]);
			String mot=ligne.split("\t")[0];
			wjkc+=Math.pow(wjk,2);
			weightmap2.put(mot,wjk);
			if(weightmap1.containsKey(mot))
			sumwijk+=weightmap1.get(mot)*weightmap2.get(mot);
		}
		Double r2= Math.sqrt(wjkc);
		score=sumwijk/(r1*r2);
		return score;
	}