use of com.graphaware.nlp.util.NodeProxy in project neo4j-nlp by graphaware.
the class ConceptRequestUnitTest method testRequestThrowsFriendlyMessageWithAlmostGoodConfigKey.
@Test(expected = RuntimeException.class)
public void testRequestThrowsFriendlyMessageWithAlmostGoodConfigKey() {
Map<String, Object> map = new HashMap<>();
map.put("node", new NodeProxy());
map.put("language", "en");
map.put("admittedRelationship", new ArrayList<>());
ConceptRequest request = ConceptRequest.fromMap(map);
}
use of com.graphaware.nlp.util.NodeProxy in project neo4j-nlp by graphaware.
the class ConceptRequestUnitTest method testRequestWithLimitLongCanBeCaster.
@Test
public void testRequestWithLimitLongCanBeCaster() {
Map<String, Object> map = new HashMap<>();
map.put("tag", new NodeProxy());
map.put("admittedRelationships", Arrays.asList("IsA", "PartOf"));
map.put("admittedPos", Arrays.asList("NNS", "NN"));
map.put("language", "en");
map.put("splitTag", true);
map.put("limit", 50L);
ConceptRequest request = ConceptRequest.fromMap(map);
assertEquals(50, request.getResultsLimit());
}
use of com.graphaware.nlp.util.NodeProxy in project neo4j-nlp by graphaware.
the class ConceptRequestUnitTest method testConceptRequestFromMap.
@Test
public void testConceptRequestFromMap() {
Map<String, Object> map = new HashMap<>();
map.put("tag", new NodeProxy());
map.put("admittedRelationships", Arrays.asList("IsA", "PartOf"));
map.put("admittedPos", Arrays.asList("NNS", "NN"));
map.put("splitTag", true);
map.put("relDirection", "out");
ConceptRequest request = ConceptRequest.fromMap(map);
assertEquals(2, request.getAdmittedRelationships().size());
assertTrue(request.getAdmittedRelationships().contains("IsA"));
assertEquals(2, request.getAdmittedPos().size());
assertEquals("out", request.getRelDirection());
}
Aggregations