code: public void evaluateAnalogies(Matrix projection, String inputFileName, String outputFileName) {
              try {
                  Scanner sc = new Scanner(new File(inputFileName));
                  PrintStream out = new PrintStream(new FileOutputStream(outputFileName));
                  while (sc.hasNext()) {
                      String analogy = sc.next();
                      if (!isAnalogyFormat(analogy,true)) {
                          System.err.println("\"" + analogy + "\" not in proper format.");
                          continue;
                      }
                      double cosineVal = computeCosineSimilarity(analogy, projection); //does the actual cosine value calculations and comparisons
                      out.println(analogy + " = " + cosineVal);
                  }
                  sc.close();
                  out.close();
              } catch (Exception e) {
                  System.err.println("Could not read file.");
              }
      }
docs: Reads analogies from file and outputs their cosine similarities to another file.
  
  @param projection the projection {@code Matrix}
  @param inputFileName the input file containing analogies in the proper format
  separated by newlines
  @param outputFileName the output file where the results will be stored
  @return void
  
  @see #computeCosineSimilarity(String,Matrix)