document word analogy calculation