com.textrazor
Class TextRazor

java.lang.Object
  extended by com.textrazor.TextRazor

public class TextRazor
extends java.lang.Object


Constructor Summary
TextRazor(java.lang.String apiKey)
          Creates a new TextRazor client with the specified API Key.
 
Method Summary
 void addExtractor(java.lang.String extractor)
          Adds a new "extractor" to the request.
 AnalyzedText analyze(java.lang.String text)
          Makes a TextRazor request to analyze a string and returning TextRazor metadata.
 java.lang.String getApiKey()
           
 java.util.List<java.lang.String> getDbpediaTypeFilters()
          Gets the list of DBPedia types to filter entity extraction.
 java.util.List<java.lang.String> getExtractors()
           
 java.util.List<java.lang.String> getFreebaseTypeFilters()
          Gets the list of Freebase types to filter entity extraction.
 java.lang.String getLanguageOverride()
          Gets the ISO-639-2 language code to use to analyze content.
 java.lang.String getRules()
           
 java.lang.String getSecureTextrazorEndpoint()
           
 java.lang.String getTextrazorEndpoint()
           
 boolean isCleanupHTML()
           
 boolean isDoCompression()
           
 boolean isDoEncryption()
           
 void setApiKey(java.lang.String apiKey)
           
 void setCleanupHTML(boolean cleanupHTML)
           
 void setDbpediaTypeFilters(java.util.List<java.lang.String> dbpediaTypeFilters)
          Sets the list of DBPedia types to filter entity extraction.
 void setDoCompression(boolean doCompression)
           
 void setDoEncryption(boolean doEncryption)
          Set to true to encrypt all TextRazor requests.
 void setExtractors(java.util.List<java.lang.String> extractors)
          Sets the set of "extractors" used to extract data from requests sent from this class.
 void setFreebaseTypeFilters(java.util.List<java.lang.String> freebaseTypeFilters)
          Sets the list of Freebase types to filter entity extraction.
 void setLanguageOverride(java.lang.String languageOverride)
          When set to a ISO-639-2 language code, force TextRazor to analyze content with this language.
 void setRules(java.lang.String rules)
          Sets a string containing Prolog logic.
 void setSecureTextrazorEndpoint(java.lang.String secureTextrazorEndpoint)
           
 void setTextrazorEndpoint(java.lang.String textrazorEndpoint)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextRazor

public TextRazor(java.lang.String apiKey)
Creates a new TextRazor client with the specified API Key.

Parameters:
apiKey -
Method Detail

analyze

public AnalyzedText analyze(java.lang.String text)
                     throws NetworkException,
                            AnalysisException
Makes a TextRazor request to analyze a string and returning TextRazor metadata.

Parameters:
text - The content to analyze
Returns:
The TextRazor metadata
Throws:
NetworkException
AnalysisException

getApiKey

public java.lang.String getApiKey()
Returns:
The API Key used to authenticate requests.

setApiKey

public void setApiKey(java.lang.String apiKey)
Parameters:
apiKey - The API Key used to authenticate requests

getTextrazorEndpoint

public java.lang.String getTextrazorEndpoint()
Returns:
The TextRazor Endpoint used for requests.

setTextrazorEndpoint

public void setTextrazorEndpoint(java.lang.String textrazorEndpoint)
Parameters:
textrazorEndpoint - The custom TextRazor Endpoint for requests made by this class.

getExtractors

public java.util.List<java.lang.String> getExtractors()
Returns:
List of "extractors" used to extract data from requests sent from this class.

setExtractors

public void setExtractors(java.util.List<java.lang.String> extractors)
Sets the set of "extractors" used to extract data from requests sent from this class. Valid options: entities, topics, words, dependency-trees, relations, entailments, senses

Parameters:
extractors - List of string extractor names.

addExtractor

public void addExtractor(java.lang.String extractor)
Adds a new "extractor" to the request.

Parameters:
extractor - The new extractor name

setRules

public void setRules(java.lang.String rules)
Sets a string containing Prolog logic. All rules matching an extractor name listed in the request will be evaluated and all matching param combinations linked in the response.

Parameters:
rules - Custom Prolog rules

getRules

public java.lang.String getRules()
Returns:
Custom rules to apply to this request.

isDoCompression

public boolean isDoCompression()
Returns:
true if compression is enabled on all TextRazor requests.

setDoCompression

public void setDoCompression(boolean doCompression)
Parameters:
doCompression - When true do compression on all TextRazor requests.

isDoEncryption

public boolean isDoEncryption()
Returns:
True if TextRazor requests are encrypted.

setDoEncryption

public void setDoEncryption(boolean doEncryption)
Set to true to encrypt all TextRazor requests.

Parameters:
doEncryption -

isCleanupHTML

public boolean isCleanupHTML()
Returns:
true if boilerplate HTML is filtered before processing by TextRazor.

setCleanupHTML

public void setCleanupHTML(boolean cleanupHTML)
Parameters:
cleanupHTML - to true to clean boilerplate HTML before processing by TextRazor.

getLanguageOverride

public java.lang.String getLanguageOverride()
Gets the ISO-639-2 language code to use to analyze content. If null TextRazor will use the automatically identified language.

Returns:
the ISO-639-2 language code

setLanguageOverride

public void setLanguageOverride(java.lang.String languageOverride)
When set to a ISO-639-2 language code, force TextRazor to analyze content with this language. If null TextRazor will use the automatically identified language.

Parameters:
languageOverride - the new ISO-639-2 language code

getDbpediaTypeFilters

public java.util.List<java.lang.String> getDbpediaTypeFilters()
Gets the list of DBPedia types to filter entity extraction. All returned entities must match at least one of these types. See the Type Dictionary for more details on supported types.

Returns:
List of DBPedia types

setDbpediaTypeFilters

public void setDbpediaTypeFilters(java.util.List<java.lang.String> dbpediaTypeFilters)
Sets the list of DBPedia types to filter entity extraction. All returned entities must match at least one of these types. See the Type Dictionary for more details on supported types.

Parameters:
dbpediaTypeFilters - New list of DBPedia types

getFreebaseTypeFilters

public java.util.List<java.lang.String> getFreebaseTypeFilters()
Gets the list of Freebase types to filter entity extraction. All returned entities must match at least one of these types. See the Type Dictionary for more details on supported types.

Returns:
List of Freebase types

setFreebaseTypeFilters

public void setFreebaseTypeFilters(java.util.List<java.lang.String> freebaseTypeFilters)
Sets the list of Freebase types to filter entity extraction. All returned entities must match at least one of these types. See the Type Dictionary for more details on supported types.

Parameters:
freebaseTypeFilters - New List of Freebase types

getSecureTextrazorEndpoint

public java.lang.String getSecureTextrazorEndpoint()
Returns:
The TextRazor Endpoint used for making encrypted requests in this class.

setSecureTextrazorEndpoint

public void setSecureTextrazorEndpoint(java.lang.String secureTextrazorEndpoint)
Parameters:
secureTextrazorEndpoint - The TextRazor Endpoint used for making encrypted requests.