Compare two word-based arrays and return the dirrenect indices in two arrays