Ejemplo n.º 1
0
  @Test
  public void testSingleWordLabels() {
    createDocuments("coal is", "coal is", "mining", "mining");

    final int[][] expectedDocumentIndices = new int[][] {new int[] {0}, new int[] {1}};

    documentAssigner.minClusterSize = 1;
    check(expectedDocumentIndices, -1);
  }
Ejemplo n.º 2
0
  @Test
  public void testStemmedSingleWordLabelConflation() {
    createDocuments("cat", "cat", "cat", "cat", "cats", "cats", "cats", "cats");

    final int[][] expectedDocumentIndices = new int[][] {new int[] {0, 1, 2, 3}};

    documentAssigner.minClusterSize = 1;
    check(expectedDocumentIndices, -1);
  }
Ejemplo n.º 3
0
  @Test
  public void testPhraseLabelsExactMatch() {
    createDocuments(
        "data is cool", "data is cool", "data is cool", "data is cool", "data cool", "data cool");

    final int[][] expectedDocumentIndices = new int[][] {new int[] {0, 1}};

    documentAssigner.exactPhraseAssignment = true;
    documentAssigner.minClusterSize = 2;
    check(expectedDocumentIndices, 0);
  }
Ejemplo n.º 4
0
  @Test
  public void testMinClusterSize() {
    createDocuments("test coal", "test coal", "coal test . mining", "coal test . mining");

    final int[][] expectedDocumentIndices =
        new int[][] {
          new int[] {0, 1},
          new int[] {0, 1},
          new int[] {0, 1},
          new int[] {0, 1}
        };

    documentAssigner.minClusterSize = 2;
    check(expectedDocumentIndices, 2);
  }
Ejemplo n.º 5
0
  @Test
  public void testStemmedPhraseLabelConflation() {
    createDocuments(
        "cat horse",
        "cat horse",
        "cats horse",
        "cats horse",
        "cat horses",
        "cat horses",
        "cats horses",
        "cats horses");

    final int[][] expectedDocumentIndices =
        new int[][] {
          new int[] {0, 1, 2, 3},
          new int[] {0, 1, 2, 3},
          new int[] {0, 1, 2, 3}
        };

    documentAssigner.minClusterSize = 1;
    check(expectedDocumentIndices, 2);
  }