コード例 #1
0
  @Test
  public void testGenerateSQL() {
    MovieVectorBuilder builder = new MovieVectorBuilder();

    for (String question : questions) {
      System.out.println(question);
      builder.generateQuestionVector(question);
      for (int i = 0; i < builder.SIZE; i++) {
        System.out.print((i + 1) + "\t");
      }
      System.out.println();
      for (int i = 0; i < builder.qvector.length; i++) {
        System.out.print(builder.qvector[i] + "\t");
      }
      System.out.println();

      for (int i = 0; i < builder.sems.length; i++) {
        System.out.print(builder.sems[i] + "\t");
      }
      System.out.println();
      System.out.println();

      String sql = builder.generateSQL();
      System.out.println(sql);
      System.out.println(SQLiteRunner.getSQLResult(Config.getMovieDB(), sql));
      System.out.println(
          "-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
    }
  }
コード例 #2
0
  // @Test
  public void testGenerateQuestionVector() {
    MovieVectorBuilder builder = new MovieVectorBuilder();

    for (String question : questions) {
      System.out.print(question + ",");
      builder.generateQuestionVector(question);
      //			for (int i = 0; i < builder.SIZE; i++) {
      //				System.out.print((i+1)+"\t");
      //			}
      //			System.out.println();

      //			System.out.print("MW"+"\t\t");
      //			System.out.print("MO"+"\t\t");
      //			System.out.print("MW2"+"\t\t");
      //			System.out.print("MO2"+"\t\t");
      //			System.out.print("DOB"+"\t\t");
      //			System.out.print("POB"+"\t\t");
      //			System.out.print("MYEAR"+"\t\t");
      //			System.out.print("RATING"+"\t\t");
      //			System.out.print("RUNTIME"+"\t\t");
      //			System.out.print("GENRE"+"\t\t");
      //			System.out.print("ERANK"+"\t\t");
      //			System.out.print("ATYPE"+"\t\t");
      //			System.out.print("AYEAR"+"\t\t");
      //			System.out.print("ACT"+"\t\t");
      //			System.out.print("DIRECT"+"\t\t");
      //			System.out.print("WIN"+"\t\t");
      //			System.out.println();
      for (int i = 0; i < builder.qvector.length; i++) {
        System.out.print(builder.qvector[i] + ",");
      }
      System.out.println();

      //			for (int i = 0; i < builder.sems.length; i++) {
      //				System.out.print(builder.sems[i]+"\t");
      //			}

    }
  }