All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.idilia.services.text.DisambiguateResponse Maven / Gradle / Ivy

Go to download

Idilia Java SDK provides Java APIs for building software using Idilia linguistic services (Language graph, word sense disambiguation, paraphrasing, matching).

The newest version!
/**
 * Copyright (c) 2011 Idilia Inc, All rights reserved.
 */

package com.idilia.services.text;

import java.util.ArrayList;

import com.idilia.services.base.ResponseBase;


/**
 * Response from the document server.
 *
 */
public class DisambiguateResponse extends ResponseBase {

  /**
   * Store the annotated document received in the server's response. Normally not used by application code.
   * @param document recovered
   */
  final void addResult(DisambiguatedDocument r) {
    this.results.add(r);
  }
  
  /**
   * Return the result when the request included a single document to process.
   * @return document recovered
   */
  public final DisambiguatedDocument getResult() {
    return results.get(results.size() - 1);
  }
  
  /**
   * Return the results for all the documents requested.
   * @return all documents recovered
   */
  public final ArrayList getResults() {
    return results;
  }
  
  /**
   * Creates an empty object. Normally not used by application code.
   */
  DisambiguateResponse() {}

  private ArrayList results = new ArrayList();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy