Esempio n. 1
0
  @Test
  public void test() {
    List<String> texts =
        Lists.newArrayList(
            "Google invests in companies since they have more choices.",
            "They understand it is hard.");
    List<String> actualList = coref.getCoref(texts);
    List<String> expectedList =
        ImmutableList.of(
            "Google invests in companies since companies have more choices .",
            "companies understand Google is hard .");

    for (int i = 0; i < actualList.size(); i++) {
      assertEquals(expectedList.get(i), actualList.get(i));
    }
  }
Esempio n. 2
0
  @Test
  public void testStanfordCoref2() {
    String input1 =
        "Other important legislation involved economic matters, including the first income tax and higher tariffs.";
    String input2 =
        "The Morrill Land-Grant Colleges Act, also signed in 1862, provided government grants for agricultural universities in each state.";
    List<String> corefed = coref.getCoref(Lists.newArrayList(input1, input2));

    List<String> expected =
        Lists.newArrayList(
            "Other important legislation involved economic matters , including the first income tax and higher tariffs .",
            "The Morrill Land-Grant Colleges Act , also signed in 1862 , provided government grants for agricultural universities in each state .");

    for (int i = 0; i < expected.size(); i++) {
      assertEquals(expected.get(i), corefed.get(i));
    }
  }