public static int BiGram_compute(String target, String word){
        int similarity = 0;
        char char1, char2;

        StringBuilder wordStr1 = new StringBuilder('#' + word);
        StringBuilder wordStr2 = new StringBuilder(word + '#');

        Queue<Character> targetQueue1 = new LinkedList<Character>();
        Queue<Character> targetQueue2 = new LinkedList<Character>();

        // the target word becomes two queue, e.g. "words"
        // the first queue:  #words
        // the second queue: words#
        targetQueue1.offer('#');
        for(int i = 0; i < target.length(); i++) {
            targetQueue1.offer(target.charAt(i));
            targetQueue2.offer(target.charAt(i));
        }
        targetQueue2.offer('#');

        while(!targetQueue1.isEmpty()){
            // dequeue the first element of
            // the two queue, and then
            // will produce the pairs of "#w","wo",
            // "or","rd","ds","s#".
            char1 = targetQueue1.poll();
            char2 = targetQueue2.poll();

            for(int i = 0; i < wordStr1.length(); i++) {
                if(char1 == wordStr1.charAt(i) && char2 == wordStr2.charAt(i)) {

                    similarity += 1;
                    wordStr1.deleteCharAt(i);
                    wordStr2.deleteCharAt(i);
                    break;
                }
            }
        }
        // the less, the more similar
        return target.length() + word.length() - 2 * similarity;
        // return similarity;
    }