Package com.clearforest.calais.common

Examples of com.clearforest.calais.common.CalaisJavaIf


    keys[10] = "jt5pyvr9f428f3qr4rsyh6dg";
    keys[11] = "sg87qnkr8c5jjw233ezejqwh";
    keys[12] = "fkrrhm7w8asp3dchddzvzzs3";
    keyIndex = 0;
    requestCount = 8600; //roughly where it left off
    calais = new CalaisJavaIf(keys[keyIndex]);
  }
View Full Code Here


    updateRequestCount();
   
    //Hacky key rotation scheme to hopefully bypass the time and rate limits...
    keyIndex++;
    if(keyIndex >= keys.length) keyIndex = 0;
    calais = new CalaisJavaIf(keys[keyIndex]);
       
    CalaisClassification result = new CalaisClassification();   
    String xmlResponse = StringUtils.unescapeHTML(calais.callEnlighten(text));
         
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
View Full Code Here

 
  private static boolean updateKey() {
    if(keyIndex < keys.length - 1) {
      System.out.println("Trying another Calais key...");
      keyIndex++;
      calais = new CalaisJavaIf(keys[keyIndex]);
      System.out.println("Using key "+keyIndex);
      return true;
    } else {
      System.out.println("Out of Calais keys to try");
      return false;
View Full Code Here

TOP

Related Classes of com.clearforest.calais.common.CalaisJavaIf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.