public static int[] buildFingerPrint(Path path, HashFunction func, int b, int k) {
    
	if (b <= 0 || b > 16)
	    throw new AssertionError("hyperLogLog :  b <= 0 or b > 16");

	int m = 1 << b; // m = 2^b
	int[] M = new int[m]; // M initialized to 0 by default
	
	// A little more complicated than the first version because we want to
	// be able to count the number of k-shingles.
	int comp = 0;
	StringBuilder strBuilder = new StringBuilder();
	LinkedList<Integer> indexes = new LinkedList<Integer>();

	for (String s : new WordReader(path))
		if (comp < k) {
	    	strBuilder.append(s);
	    	indexes.add(s.length());
	    	comp++;
		} else {
	    	strBuilder.replace(0, indexes.poll(), "");
	    	strBuilder.append(s);
	    	indexes.add(s.length());
	    	long x = func.hashString(strBuilder.substring(0));
	    	int j = (int) (x & (m - 1));
	    	long w = x >>> b;
			M[j] = Math.max(M[j], rho(w));
	    }

	return M;
    }