您好,我尝试从结果中提取返回的实体值
SPTUser.requestCurrentUser(withAccessToken:(SPTAuth.defaultInstance().session.accessToken)!) { (error, data) in
guard let user = data as? SPTUser else { print("Couldn't cast as SPTUser"); return }
let userId = user.canonicalUsername
})
输出格式为:
DetectEntitiesRequest request = new DetectEntitiesRequest();
request.setText("Abdominal ultrasound noted acute appendicitis, recommend appendectomy followed by several series of broad spectrum antibiotics");
DetectEntitiesResult result = client.detectEntities(request);
// result.getEntities().forEach(System.out::println);
List<Entity> entityList = result.getEntities();
System.out.println("\n==> Iterator...");
Iterator<Entity> entityIterator = entityList.iterator();
while (entityIterator.hasNext()) {
System.out.println(entityIterator.next());
}
我只想获取每个元素和值,例如Id,BeginOffset,EndOffset,Score等。