public class OpenCalaisClassifier extends AbstractExtractor
Modifier and Type | Class and Description |
---|---|
class |
OpenCalaisClassifier.OpenCalaisSimpleResultParser |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
apikey |
protected static java.lang.String |
CALAIS_SI |
protected static java.lang.String |
CALAIS_TOPIC_SI |
private java.lang.String |
contentType |
private java.lang.String[] |
contentTypes |
private java.lang.String |
defaultEncoding |
protected static java.lang.String |
DOCUMENT_SI |
protected static boolean |
EXTRACT_RELEVANCE |
protected static boolean |
EXTRACT_SCORE |
protected static java.lang.String |
OPENCALAIS_TAG_CLASSIFICATION_SI |
protected static java.lang.String |
OPENCALAIS_TOPIC_CLASSIFICATION_SI |
private java.lang.String |
params |
protected static java.lang.String |
RELEVANCE_SI |
protected static java.lang.String |
SCORE_SI |
protected static java.lang.String |
SOURCE_SI |
protected static java.lang.String |
TAG_SI |
protected static java.lang.String |
TOPIC_SI |
CUSTOM_EXTRACTOR, DONE_FAILED, DONE_MANY, DONE_ONE, EXACTLY_GIVEN_URLS, FILE_EXTRACTOR, FILE_PATTERN, GIVEN_URLS_AND_ALL_CRAWLED_DOCUMENTS, GIVEN_URLS_AND_CRAWLED_DOCUMENTS_IN_URL_DOMAIN, GIVEN_URLS_AND_LINKED_DOCUMENTS, GIVEN_URLS_AND_URL_BELOW, INFO_WAIT_WHILE_WORKING, LOG_TITLE, POINT_START_URL_TEXT, RAW_EXTRACTOR, SELECT_DIALOG_TITLE, STRING_EXTRACTOR_NOT_SUPPORTED_MESSAGE, URL_EXTRACTOR
CLOSE, EXECUTE, INVISIBLE, VISIBLE, WAIT
RETURN_ERROR, RETURN_INFO
Constructor and Description |
---|
OpenCalaisClassifier()
Creates a new instance of OpenCalaisClassifier
|
Modifier and Type | Method and Description |
---|---|
boolean |
_extractTopicsFrom(java.io.File file,
TopicMap topicMap) |
boolean |
_extractTopicsFrom(java.io.InputStream in,
TopicMap topicMap) |
boolean |
_extractTopicsFrom(java.lang.String in,
TopicMap topicMap) |
boolean |
_extractTopicsFrom(java.net.URL url,
TopicMap topicMap) |
boolean |
acceptBrowserExtractRequest(BrowserExtractRequest request,
Wandora wandora) |
void |
configure(Wandora admin,
Options options,
java.lang.String prefix)
If the tool is configurable, shows an user interface to configure the tool.
|
java.lang.String |
doBrowserExtract(BrowserExtractRequest request,
Wandora wandora) |
void |
fillDocumentTopic(Topic textTopic,
TopicMap topicMap,
java.lang.String content) |
void |
forgetAuthorization() |
java.lang.String |
getBrowserExtractorName() |
Topic |
getCalaisClass(TopicMap tm) |
Topic |
getCalaisTagClassificationType(TopicMap tm) |
Topic |
getCalaisTopic(java.lang.String topic,
java.lang.String taxonomy,
TopicMap tm) |
Topic |
getCalaisTopicClassificationType(TopicMap tm) |
Topic |
getCalaisTopicType(TopicMap tm) |
java.lang.String[] |
getContentTypes()
Returns an array of String containing the content-types this
ContentHandler can process. |
java.lang.String |
getDescription()
AdminToolManager views tool descriptions while user browses available
tools and build user customizable GUI elements such as Tools menu.
|
Topic |
getDocumentType(TopicMap tm) |
javax.swing.Icon |
getIcon()
All tools may have identifying graphic icon used within tool GUI elements.
|
java.lang.String |
getName()
Tools name represent the tool in UI unless the tool has been given
explicitly another GUI name.
|
protected Topic |
getOrCreateTopic(TopicMap tm,
java.lang.String si) |
protected Topic |
getOrCreateTopic(TopicMap tm,
java.lang.String si,
java.lang.String bn) |
Topic |
getRelevanceTopic(java.lang.String relevance,
TopicMap tm) |
Topic |
getRelevanceType(TopicMap tm) |
Topic |
getScoreTopic(java.lang.String score,
TopicMap tm) |
Topic |
getScoreType(TopicMap tm) |
Topic |
getSourceType(TopicMap tm) |
Topic |
getTagTopic(java.lang.String tag,
TopicMap tm) |
Topic |
getTagType(TopicMap tm) |
Topic |
getTagValue(java.lang.String val,
java.lang.String tag,
TopicMap tm) |
Topic |
getTopicType(TopicMap tm) |
Topic |
getWandoraClass(TopicMap tm) |
boolean |
isConfigurable()
Whether this tool is configurable.
|
protected void |
makeSubclassOf(TopicMap tm,
Topic t,
Topic superclass) |
java.lang.String |
solveAPIKey() |
java.lang.String |
solveAPIKey(Wandora wandora) |
java.lang.String |
solveTitle(java.lang.String content) |
void |
writeOptions(Wandora admin,
Options options,
java.lang.String prefix)
If the tool is configurable, saves all current tool options.
|
addCrawlerUrl, browserExtractorConsumesPlainText, buildSI, buildSL, clearMasterSubject, createAssociation, createAssociation, createTopic, createTopic, createTopic, createTopic, createTopic, createTopic, createTopic, croppedFilename, croppedFilename, croppedUrlString, croppedUrlString, dropExtract, dropExtract, dropExtract, execute, extractTopicsFrom, extractTopicsFrom, extractTopicsFrom, extractTopicsFrom, extractTopicsFromText, getCrawlerMode, getExtractorType, getForceContent, getForceFiles, getForceUrls, getGUIText, getGUIText, getInterruptsHandled, getMasterSubject, getType, getWandora, handle, handleContent, handleCustomType, handleFiles, handleForcedContent, handleInterrupt, handleStringContent, handleUrls, initializeCustomType, instantDropHandle, makeSubclassOfWandoraClass, runInOwnThread, setData, setDisplayName, setForceContent, setForceFiles, setForceUrls, setMasterSubject, setMasterSubject, setTopicMap, setupCrawler, setWandora, takeNap, urlEncode, useTempTopicMap, useURLCrawler
addUndoMarker, addUndoMarker, allowMultipleInvocations, clearAllThreads, clearThreads, clearThreads, clearToolLock, clearToolLock, clearToolLocks, execute, execute, forceStop, forceStop, getContext, getCurrentLogger, getDefaultLogger, getHistory, getLastLogger, getState, getThreads, getThreads, getToolMenuItem, getToolMenuItem, getTopicName, hlog, initialize, interruptAllThreads, interruptThreads, interruptThreads, isRunning, isRunning, lockLog, log, log, log, log, requiresRefresh, run, setContext, setDefaultLogger, setLogTitle, setProgress, setProgressMax, setState, setToolLogger, singleLog, singleLog, singleLog, solveContextTopicMap, solveNameForTopicMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, execute, getContext, getToolMenuItem, hlog, initialize, isRunning, log, log, log, log, requiresRefresh, setContext, setToolLogger
forceStop, getHistory, getState, lockLog, setLogTitle, setProgress, setProgressMax, setState
protected static final boolean EXTRACT_RELEVANCE
protected static final boolean EXTRACT_SCORE
protected static final java.lang.String CALAIS_SI
protected static final java.lang.String CALAIS_TOPIC_SI
protected static final java.lang.String TAG_SI
protected static final java.lang.String OPENCALAIS_TAG_CLASSIFICATION_SI
protected static final java.lang.String OPENCALAIS_TOPIC_CLASSIFICATION_SI
protected static final java.lang.String TOPIC_SI
protected static final java.lang.String SOURCE_SI
protected static final java.lang.String DOCUMENT_SI
protected static final java.lang.String RELEVANCE_SI
protected static final java.lang.String SCORE_SI
private java.lang.String contentType
private java.lang.String defaultEncoding
private java.lang.String params
private final java.lang.String[] contentTypes
private static java.lang.String apikey
public OpenCalaisClassifier()
public java.lang.String getName()
AbstractWandoraTool
getName
in interface WandoraTool
getName
in class AbstractExtractor
public java.lang.String getDescription()
AbstractWandoraTool
getDescription
in interface WandoraTool
getDescription
in class AbstractExtractor
public javax.swing.Icon getIcon()
AbstractWandoraTool
getIcon
should return Icon
object of
the tool.getIcon
in interface WandoraTool
getIcon
in class AbstractExtractor
public java.lang.String[] getContentTypes()
Handler
ContentHandler
can process.getContentTypes
in interface Handler
getContentTypes
in class AbstractExtractor
public boolean _extractTopicsFrom(java.net.URL url, TopicMap topicMap) throws java.lang.Exception
_extractTopicsFrom
in class AbstractExtractor
java.lang.Exception
public boolean _extractTopicsFrom(java.io.File file, TopicMap topicMap) throws java.lang.Exception
_extractTopicsFrom
in class AbstractExtractor
java.lang.Exception
public boolean _extractTopicsFrom(java.io.InputStream in, TopicMap topicMap) throws java.lang.Exception
java.lang.Exception
public boolean _extractTopicsFrom(java.lang.String in, TopicMap topicMap) throws java.lang.Exception
_extractTopicsFrom
in class AbstractExtractor
java.lang.Exception
public java.lang.String doBrowserExtract(BrowserExtractRequest request, Wandora wandora) throws TopicMapException
doBrowserExtract
in interface BrowserPluginExtractor
doBrowserExtract
in class AbstractExtractor
TopicMapException
public boolean acceptBrowserExtractRequest(BrowserExtractRequest request, Wandora wandora) throws TopicMapException
acceptBrowserExtractRequest
in interface BrowserPluginExtractor
acceptBrowserExtractRequest
in class AbstractExtractor
TopicMapException
public java.lang.String getBrowserExtractorName()
getBrowserExtractorName
in interface BrowserPluginExtractor
getBrowserExtractorName
in class AbstractExtractor
public java.lang.String solveTitle(java.lang.String content)
public void fillDocumentTopic(Topic textTopic, TopicMap topicMap, java.lang.String content)
public Topic getRelevanceTopic(java.lang.String relevance, TopicMap tm) throws TopicMapException
TopicMapException
public Topic getScoreTopic(java.lang.String score, TopicMap tm) throws TopicMapException
TopicMapException
public Topic getCalaisTopic(java.lang.String topic, java.lang.String taxonomy, TopicMap tm) throws TopicMapException
TopicMapException
public Topic getTagTopic(java.lang.String tag, TopicMap tm) throws TopicMapException
TopicMapException
public Topic getTagValue(java.lang.String val, java.lang.String tag, TopicMap tm) throws TopicMapException
TopicMapException
public Topic getCalaisTopicType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getTagType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getRelevanceType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getScoreType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getCalaisClass(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getWandoraClass(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getCalaisTagClassificationType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getCalaisTopicClassificationType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getTopicType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getSourceType(TopicMap tm) throws TopicMapException
TopicMapException
public Topic getDocumentType(TopicMap tm) throws TopicMapException
TopicMapException
protected Topic getOrCreateTopic(TopicMap tm, java.lang.String si) throws TopicMapException
TopicMapException
protected Topic getOrCreateTopic(TopicMap tm, java.lang.String si, java.lang.String bn) throws TopicMapException
TopicMapException
protected void makeSubclassOf(TopicMap tm, Topic t, Topic superclass) throws TopicMapException
TopicMapException
public java.lang.String solveAPIKey(Wandora wandora)
public java.lang.String solveAPIKey()
public void forgetAuthorization()
public boolean isConfigurable()
AbstractWandoraTool
isConfigurable
in interface WandoraTool
isConfigurable
in class AbstractWandoraTool
public void configure(Wandora admin, Options options, java.lang.String prefix) throws TopicMapException
AbstractWandoraTool
configure
in interface WandoraTool
configure
in class AbstractWandoraTool
TopicMapException
public void writeOptions(Wandora admin, Options options, java.lang.String prefix)
AbstractWandoraTool
writeOptions
in interface WandoraTool
writeOptions
in class AbstractWandoraTool
Copyright 2004-2015 Wandora Team