// Path: word2vec-response/src/main/java/com/apitore/banana/response/word2vec/DistanceResponseEntity.java
// @ApiModel
// @Data
// @EqualsAndHashCode(callSuper=false)
// public class DistanceResponseEntity extends BaseResponseEntity {
// 
//   /**
//    *
//    */
//   private static final long serialVersionUID = 7070503881709006405L;
// 
//   @ApiModelProperty(required=true, value="Input word")
//   private String input;
//   @ApiModelProperty(required=true, value="Input num")
//   private String num;
//   @ApiModelProperty(required=false, value="Distances")
//   private List<DistanceEntity> distances;
// 
// }


import java.util.HashMap;
import java.util.Map;
import org.springframework.web.client.RestTemplate;
import com.apitore.banana.response.word2vec.DistanceResponseEntity;
import com.apitore.banana.utils.UrlFormatter;
package com.apitore.banana.response.word2vec.sample;






/**
 * @author Keigo Hattori
 */
public class Api8Word2VecDistanceExample {

  static String ENDPOINT     = "https://api.apitore.com/api/8/word2vec-neologd-jawiki/distance";
  static String ACCESS_TOKEN = "YOUR-ACCESS-TOKEN";

  public static void main(String[] args) {
    RestTemplate restTemplate = new RestTemplate();
    Map<String, String> params = new HashMap<String, String>();
    params.put("access_token", ACCESS_TOKEN);
    params.put("word", "犬");
    params.put("num", "5");
    String url = UrlFormatter.format(ENDPOINT, params);

    DistanceResponseEntity response =
        restTemplate.getForObject(url, DistanceResponseEntity.class, params);

    System.out.println(response.getLog());
    System.out.println(response.getDistances().get(0).getWord());
// Path: word2vec-response/src/main/java/com/apitore/banana/response/word2vec/DistanceResponseEntity.java
// @ApiModel
// @Data
// @EqualsAndHashCode(callSuper=false)
// public class DistanceResponseEntity extends BaseResponseEntity {
// 
//   /**
//    *
//    */
//   private static final long serialVersionUID = 7070503881709006405L;
// 
//   @ApiModelProperty(required=true, value="Input word")
//   private String input;
//   @ApiModelProperty(required=true, value="Input num")
//   private String num;
//   @ApiModelProperty(required=false, value="Distances")
//   private List<DistanceEntity> distances;
// 
// }


// Path: word2vec-response/src/main/java/com/apitore/banana/response/word2vec/sample/Api8Word2VecDistanceExample.java
import java.util.HashMap;
import java.util.Map;
import org.springframework.web.client.RestTemplate;
import com.apitore.banana.response.word2vec.DistanceResponseEntity;
import com.apitore.banana.utils.UrlFormatter;

package com.apitore.banana.response.word2vec.sample;






/**
 * @author Keigo Hattori
 */
public class Api8Word2VecDistanceExample {

  static String ENDPOINT     = "https://api.apitore.com/api/8/word2vec-neologd-jawiki/distance";
  static String ACCESS_TOKEN = "YOUR-ACCESS-TOKEN";

  public static void main(String[] args) {
    RestTemplate restTemplate = new RestTemplate();
    Map<String, String> params = new HashMap<String, String>();
    params.put("access_token", ACCESS_TOKEN);
    params.put("word", "犬");
    params.put("num", "5");
    String url = UrlFormatter.format(ENDPOINT, params);

    DistanceResponseEntity response =
        restTemplate.getForObject(url, DistanceResponseEntity.class, params);

    System.out.println(response.getLog());
    System.out.println(response.getDistances().get(0).getWord());
    System.out.println(response.getDistances().get(0).getDistance());