IBM Content Analyzer Programming Guide
Edition Notice
First Edition (August 2007)

This edition applies to version 8, release 4, modification 2 of IBM® Content™ Analyzer and to all subsequent releases and modifications until otherwise indicated in new editions.

This document contains proprietary information of IBM. This proprietary information is provided in accordance with the license conditions and is protected by copyright. Information contained in this document provides no warranties whatsoever for any products. Also, no descriptions provided in this document should be interpreted as product warranties. Depending on the system environment, the yen symbol may be displayed as the backslash symbol, or the backslash symbol may be displayed as the yen symbol.

© Copyright International Business Machines Corporation 2007. All rights reserved.

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

1 Introduction
This document describes how to build a custom application to utilize IBM Content Analyzer (ICA) server functions. You can see it is easy to deploy the functions of ICA in your applications after you learn some manners to use application programming interfaces of ICA.
1.1 Functional Overview
ICA provides both GUI for end-users and API for applications. Standard configuration of ICA server system is shown in Figure 1. By ICA indexer, information extracted by ICA preprocessing is stored in ICA index. ICA server, usually running on IBM WebSphere Application Server, reads the index and gets information on the keywords and documents specified by a query from a user. ICA server has two ways to return search/mining results. One is TEXT MINER, an application providing GUI for end users. TEXT MINER is deployed on WebSphere Application Server.
The other is ICA User API, providing interface (API) and implementation for application programs to use ICA server functions. This document introduces this API and concrete examples of programming.


Figure 1. Standard configuration of ICA server


As in Figure 1, programming interfaces are completely separated from the implementation of ICA server. This programming interface consists of a set of Java APIs, which is called ICA User API or simply API in this document.
Almost all the functions a user can access from TEXT MINER (a GUI application bundled with ICA) are also accessible from the ICA User API, so that users can create an alternative GUI for TEXT MINER. ICA User API is provided only for Java language. In order to build a custom application using ICA User API, the user need to add the following two JAR files into the classpath.
  • %TAKMI_HOME%/lib/TAKMI_MINER_API.jar
  • %TAKMI_HOME%/lib/TAKMI_SDK.jar
1.2 User API Structure

ICA User API provides a way to connect to a database, use both search engines and mining engines, and manipulate other resources such as category trees.
Here we introduce elements of ICA User API. Figure 2 will help you understand the following descriptions.


Figure 2. Basic interfaces of ICA User API

TextMiner is an interface providing all other interfaces with respect to a target document set. This hides the back-end implementation of the server, so application developers can concentrate on how they use mining functionality.

CategoryTree corresponds to a set of categories. Category represents a node in the category tree. Each Category holds the name and the path from the root node.

SearchQuery holds the search condition in a tree structure, and each condition node can be a keyword condition node, a category condition node, or a mix of them. It’s used to narrow down the target result document set which are returned by the mining functions. There are two ways to build a search condition tree inside a SearchQuery instance. One way is to call utility functions the TEXT MINER provides. The other way is to create search condition nodes (SearchConditionNode), build a tree structure of search condition by hand, and set it to the SearchQuery. SearchConditionNode is created by SearchConditionNodeFactory.

MiningFunction is used to execute a built-in mining functionality provided by ICA. Currently the following functions are available as a subclass of MiningFunction.
  • TopViewFunction
  • DocListViewFunction
  • CategoryViewFunction
  • TimeSeriesViewFunction
  • TopicViewFunction
  • DeltaViewFunction
  • TwoDMapViewFunction

2 Application Programming Interfaces
2.1 Database API
TextMiner provides almost all functionalities for building custom mining applications. In your applications, a TextMiner instance must be first obtained, and the database to be connected must be selected next. Prior to obtaining a TextMiner instance, TAKMI_HOME variable must be defined as an environment variable in your operating system. If it is not defined, you have to set it explicitly in your code.

2.1.1 Provided Functions
The following functions are provided for database operation.
class com.ibm.takmi.ext.TextMiner
API Return Description

getDatabaseNames()
(static function)

returns: String[]
throws: MinerException
Return a list of available database names.
getInstance(
String databaseName)
(static function)
returns: TextMiner
throws: MinerException
Return TextMiner instance.
releaseDatabase() returns: (void)
throws: MinerException
Release the currently selected database.

Users can get the list of available database names by calling TextMiner#getDatabaseNames() (static method). Then, users can get the TextMiner instance by calling TextMiner#selectDatabase() specifying one of the listed database name as an argument, which is the only way to obtain TextMiner instance. These functions may throw MinerException (com.ibm.takmi.ext.MinerException), which is a common exception thrown by TAKMI MINER API, so users also need to take care of the exception handling.

2.1.2 Sample Code
import com.ibm.takmi.ext.MinerException;
import com.ibm.takmi.ext.TextMiner;
:
(snip)
:
// If TAKMI_HOME environment variable is not defined, set here
// System.setProperty("TAKMI_HOME", "C:\\Program Files\\IBM\\takmi");

try {
  // Get database name list
   String databaseNames[] = TextMiner.getDatabaseNames();

  // Get TextMiner instance
  TextMiner miner = TextMiner.getInstance(“SAMPLE_DATABASE”);

  } catch (MinerException e) {
  // Do exception handling here
}

2.2 Category API
A category is a node in a category tree that is predefined in the TAKMI server, and each category consists of path (unique expression) and name (understandable word). In applications, a category is represented by an instance that implements Category interface (com.ibm.takmi.ext.Category). TextMiner provides a couple of functions that allow users to obtain Category from the category tree on the server.

2.2.1 Provided Functions
The following functions are provided for category operation.
class com.ibm.takmi.ext.TextMiner
API Return Description

getRootCategories()

returns: Category[]
throws: MinerException
Return the list of root (top-level) categories defined in the category tree.
getChildCategories(
Category category)
returns: Category[]
throws: MinerException
Return a list of subcategories under the specified category.
getCategory(
String categoryPath)
returns: Category
throws: MinerException
Return the category of the specified category path.
dumpCategoryTree() returns: String
throws: MinerException
Return an XML String that describes the hierarchy structure of category tree.

class com.ibm.takmi.ext.Category
API Return Description
getPath() returns: String
throws: (none)
Returns the category path.
getName() returns: String
throws: (none)
Returns the category name.

TextMiner#getRootCategories() provides the array of root categories in the category tree on server. The list of the child categories of a certain category can be obtained by calling TextMiner#getChildCategories() specifying the parent category as an argument.
The obtained categories can be used as a condition of a category search query or a parameter for mining functions, as described in later chapters.
These functions may throw MinerException (com.ibm.takmi.ext.MinerException), which is a common exception thrown by TAKMI MINER API, so users also need to take care of the exception handling.

2.2.2 Sample Code
import com.ibm.takmi.ext.Category;
import com.ibm.takmi.ext.TextMiner;
:
(snip)
:
Try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = ..;

  // Get root category list
  Category categories[] = miner.getRootCategories();

  // Show data for each root categories
  for (int i=0; i < categories.length; i++) {
    System.out.println(“Category name: “ + categories[i].getName());
    System.out.println(“Category path: “ + categories[i].getPath());
  }

  // Get child category list of the first root category
  Category childCategories[] = miner.getChildCategories(categories[0]);

  // Dump category tree.
   System.out.println(miner.dumpCategoryTree());

  // Get Category by category path
  Category myCategory = miner.getCategory(“".tkm_ja_base_word.noun"”)

  } catch (MinerException e) {
    // Do exception handling here
  }

2.3 Search API
By default, the target of ICA mining functions is the set of all documents in the selected database. However, users can narrow down the target document set by specifying SearchQuery as a parameter of mining functions. The SearchQuery holds the search condition in a tree structure, and each condition node can be a keyword condition node, a category condition node, or a mix of them.
There are two ways to build a search condition tree inside a SearchQuery instance. One way is to call utility functions the TextMiner provides, which are named addNodeTypeCondition. These functions allow users to build a search condition tree incrementally, like ICA TEXT MINER.
The other way is to create search condition nodes (SearchConditionNode), build a tree structure of search condition by hand, and set it to the SearchQuery. SearchConditionNodeFactory, which can be obtained from TextMiner, allows users to create all kinds of SearchConditionNode instance. This way allows users to build more complicated search condition tree than they can build using utility functions of TextMiner.

2.3.1 Provided Functions
The following functions are provided for search operation.
class com.ibm.takmi.ext.TextMiner
API Return Description
newSearchQuery() returns: SearchQuery
throws: MinerException
Returns a search query instance.
addCategoryCondition(
SearchQuery query,
Category category,
boolean isAnd,
boolean isNot)
returns: SearchConditionNode
throws: MinerException
Add category condition node with the specified category to the given search query.
addKeywordCondition(
SearchQuery query,
Category category,
String keyword,
boolean isAnd,
boolean isNot)
returns: SearchConditionNode
throws: MinerException
Add keyword condition node with the specified keyword of the specified category to the given search query, and return the added SearchConditionNode.
addKeywordCondition(
SearchQuery query,
String keyword,
boolean isAnd,
boolean isNot)
returns: SearchConditionNode
throws: MinerException
Add keyword condition node with the specified keyword of all categories to the given search query, and return the added SearchConditionNode.
addStringCondition(
SearchQuery query,
String keyword,
boolean isAnd,
boolean isNot)
returns: SearchConditionNode
throws: MinerException
Add string condition node with the specified keyword to the given search query, and return the added SearchConditionNode.
addTimeCondition(
SearchQuery query,
String timeScale,
int timeValue,
boolean isAnd,
boolean isNot)
returns: SearchConditionNode
throws: MinerException
Add time condition node with the specified time value of the specified time scale to the given search query, and return the added SearchConditionNode.
getSearchConditionNode
Factory()
returns: SearchConditionNodeFactory
throws: MinerException
Returns a search condition node factory instance.

interface com.ibm.takmi.ext.search.SearchQuery
API Return Description
setSearchConditionNode(SearchConditionNode node) returns: (void)
throws: MinerException
Sets the specified search condition node to the search query.
getSearchConditionNode() returns: SearchConditionNode
throws: (none)
Returns the search condition node set to the search query.

interface com.ibm.takmi.ext.search.SearchConditionNodeFactory
API Return Description
newKeywordNode(
Category category,
String keyword)
returns: SearchConditionNode
throws: MinerException
Returns a new keyword search condition node with the specified keyword of the specified category.
newKeywordNode(
String keyword)
returns: SearchConditionNode
throws: MinerException
Returns a new keyword search condition node of with the specified keyword of all categories.
newCategoryNode(
Category category)
returns: SearchConditionNode
throws: MinerException
Returns a new category search condition node with the specified category.
newStringNode(
String keyword)
returns: SearchConditionNode
throws: MinerException
Returns a new string search condition node with the specified string.
newTimeNode(
String timeScale,
int timeValue)
returns: SearchConditionNode
throws: MinerException
Returns a new time search condition node with the specified time value of the specified time scale.
newAndNode() returns: SearchConditionNodeWithChildren
throws: (none)
Returns a new AND search condition node.
newOrNode() returns: SearchConditionNodeWithChildren
throws: (none)
Returns a new OR search condition node.

interface com.ibm.takmi.ext.search.SearchConditionNode
(super interface of KeywordSearchConditionNode, CategorySearchConditionNode, StringSearhConditonNode, AndSearchConditionNode, OrSearchConditionNode)
API Return Description
isNot() returns: boolean
throws: (none)
Returns true if the search condition node is negative.
setNot(boolean isNot) returns: (none)
throws: (none)
Make the search condition node negative if isNot is true.
getFreqency() returns: int
throws: (none)
Returns the frequency of the search condition node.
getParent() returns: SearchConditionNode
throws: (none)
Returns the parent search condition node. Returns null if it is the root search condition node.
setParent(
SearchConditionNodeWithChildren parent)
returns: (none)
throws: MinerException
Sets the parent node to this node. If this node already has a parent, this node will be removed from the current parent.

interface com.ibm.takmi.ext.search.SearchConditionNodeWithChildren
(super interface of AndSearchConditionNode, OrSearchConditionNode)
API Return Description
setChild(SearchConditionNode node) returns: (none)
throws: MinerException
Add the specified node to the list of child nodes.
insertChildAt(int index,
SearchConditionNode node)
returns: (none)
throws: MinerException
Insert the specified node at the specified index of the child node list.
removeChild(SearchConditionNode node) returns: SearchConditionNode
throws: (none)
Remove the specified node from the list of child nodes, and return the removed node (null if not found).
size() returns: int
throws: (none)
Returns the number of child nodes.
getChildren() returns: SearchConditionNode
throws: (none)
Returns the array of child nodes.

SearchConditionNodeFactory instance can be obtained by calling TextMiner#getSearchConditionNode(). The SearchConditionNodeFactory#newKeywordNode() returns a keyword node and SearchConditionNodeFactory#newCategoryNode() returns a category node, the both nodes implementing SearchConditionNode interface. The search condition nodes can be conbined by calling setChild() function of AndSearchConditionNode or OrSearchConditionNode classes, whose instances can be obtained by SearchConditionNodeFactory#newAndNode() or SearchConditionNodeFactory#newOrNode(). The negation of each search condition node can be made by calling SearchConditionNode#setNot() with argument “true”.
These functions may throw MinerException (com.ibm.takmi.ext.MinerException), which is a common exception thrown by ICA MINER API, so users also need to take care of the exception handling.

2.3.2 Sample Code

Compose search condition using utility functions of TextMiner
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.search.SearchConditionNodeFactory;
import com.ibm.takmi.ext.search.SearchConditionNode;
import com.ibm.takmi.ext.search.SearchQuery;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting Category instance, please refer to “Category API” chapter
   Category category1 = …;
  Category category2 = …;

  //Get search query and set the search condition tree
  SearchQuery searchQuery = miner.newSearchQuery();

  //Create a search condition incrementally
  // keyword “PC” ( isAnd (3rd arg) is ignored in case of the first condition)
  miner.addKeywordCondition(query, “PC”, true, false);

  // keyword ”PC” AND NOT(keyword “display”) (isNot (4th arg) indicates a negation)
   miner.addKeywordCondition(query, category1 “display”, true, true);

  // category2 OR (“PC” and NOT(“display”))
  miner.addCategoryCondition(query, category2, false, false);

  // string “help” OR category2 OR (“PC” and NOT(“display”))
   miner.addStringCondition(query, “help”, false, false); // string “help” OR category2 OR

} catch (MinerException e) {
  // Do exception handling here
}

Compose search condition using SearchConditionNodeFactory
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.search.SearchConditionNodeFactory;
import com.ibm.takmi.ext.search.SearchConditionNode;
import com.ibm.takmi.ext.search.SearchQuery;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting Category instance, please refer to “Category API” chapter
  Category category1 = …;
  Category category2 = …;

  // Get SearchConditionNodeFactory
  SearchConditionNodeFactory nodeFactory = miner.getSearchConditionNodeFactory();

  // Create a keyword condition node
  SearchConditionNode keywordNode1 = nodeFactory.newKeywordNode( “PC”);
  SearchConditionNode keywordNode2 = nodeFactory.newKeywordNode(category1, “display”);

  // Create negation of the original condition
  keywordNode2.setNot(true);

  // Create a category condition node
  SearchConditionNode categoryNode = nodeFactory.newCategoryNode(category2);

  // Create a string condition node
  SearchConditionNode stringNode = nodeFactory.newStringNode(“PC”);

  // Compose a search condition tree
  AndSearchConditionNode andNode = nodeFactory.newAndNode();
  andNode.setChild(keywordNode1);
  andNode.setChild(keywordNode2);

  OrSearchConditionNode orNode = nodeFactory.newOrNode();
  orNode.setChild(andNode);
  orNode.setChild(categoryNode);
  orNode.setChild(stringNode);

  //Get search query and set the search condition tree
  SearchQuery searchQuery = miner.newSearchQuery();
  query.setSearchConditionNode(orNode);

} catch (MinerException e) {
  // Do exception handling here
}

2.4 Mining API
The ICA User API provides 7 mining functions to users. Each mining function (subclass of MiningFunction) has execute() method with 2 arguments, one for input parameters (subclass of MiningFunctionInputs) and the other for output parameters (subclass of MiningFunctionOutputs). Below are the steps to execute a mining function:
  1. create an instance of MiningFunction subclass
  2. create an instance of MiningFunctionInputs subclass, giving all the required input parameters
  3. create an instance of MiningFunctionOutputs subclass.
  4. call MiningFunction#execute(MiningFunctionInputs, MiningFunctionOutputs)
After the above steps, the instance of MiningFunctionOutputs subclass is filled with the results of the mining funtction.
The subsequent sections describe the 7 mining functions one by one.

2.4.1 TopViewFunction
TopViewFunction is the simplest mining function, which provides the number of documents that meets the search condition (SearchQuery instance).

2.4.1.1 Input Parameters
The input parameters for TopViewFunction must be stored in TopViewInputs instance. The table below describes the field of TopViewInputs.
Name Description Type
searchQuery Search condition to narrow down the target document set. com.ibm.takmi.ext.search.SearchQuery
Available Constructors:
  • TopViewInputs()
  • TopViewInputs(SearchQuery searchQuery)

2.4.1.2 Output Parameters
The input parameters for TopViewFunction must be stored in TopViewOutputs instance. The table below describes the field of TopViewOutputs.
Name Description Type
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
If the searchQuery in the input parameter is a null value, this value is 0.
(Getter: TopViewOutputs#getSize())
int

2.4.1.3 Sample Code
The code below describes how to execute the TopViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.topview.TopViewFunction;
import com.ibm.takmi.ext.topview.TopViewInputs;
import com.ibm.takmi.ext.topview.TopViewOutputs;
import com.ibm.takmi.ext.search.SearchConditionNode;
import com.ibm.takmi.ext.search.SearchConditionNodeWithChildren;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
  SearchQuery searchQuery = …;

  //Create instances of mining function, input and output
  TopViewFunction tvFunction = new TopVIewFunction(miner);
  TopViewInputs tvInputs = new TopViewInputs(searchQuery);
  TopViewOutputs tvOutputs = new TopViewOutputs();

  //Execute the mining function
  tvFunction.execute(tvInputs, tvOutputs);

  //Get the result from output instance
  int size = tvOutputs.getSize();

  //Print the frequencies of search condition node recursively
  SearchConditionNode node = out.getSearchQuery().getSearchConditionNode();
  printFreqs(node);

  } catch (MinerException e) {
    // Do exception handling here
  }
:
(snip)
:
// Recursive function to print the frequencies of search condition node tree.
private void printFreqs(SearchConditionNode node){
  // Print the frequency of current node
  System.out.print(node.getFrequency());

  // Check if the current node has children
  if (node instanceof SearchConditionNodeWithChildren) {
    // Get array of child SearchConditionNode
    SearchConditionNode children[] = ((SearchConditionNodeWithChildren)node).getChildren();
    System.out.print(" [ ");

    // Call printFreqs for each child
    for (int i=0; i<children.length; i++) {
      printFreqs(children[i]);
      System.out.print(" ");
    }
    System.out.print("]");
  }
}


2.4.2 DocListViewFunction
DocListViewFunction provides the array of Document, which holds the information about each document, such as document ID, title, features, and so on.

2.4.2.1 Input Parameters
The input parameters for DocListViewFunction must be stored in DocListViewInputs instance. The table below describes the field of DocListViewInputs.
Name Description Type
searchQuery
(optional)
Search condition to narrow down the target document set. If null is specified then the target is a set of all documents in the database. com.ibm.takmi.ext.search.SearchQuery
fromIndex The start index in the document set (starting from 0). When you set fromIndex=5, the output Document array starts with a Document that corresponds to the sixth document in the document set. int
pageSize The size of Document array to get. If the range specified by fromIndex and pageSize runs over the whole document set, then the result is trimmed. int
Available Constructors:
  • DocListViewInputs(int fromIndex, int pageSize)
  • DocListViewInputs(SearchQuery searchQuery, int fromIndex, int pageSize)

2.4.2.2 Output Parameters
The output parameters for DocListViewFunction is stored in DocListViewOutputs instance. The table below describes the fields of DocListViewOutputs.
Name Description Type
documents The array of Document objects.
(Getter: DocListViewOutputs#getDocuments())
com.ibm.takmi.ext.Document
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
(Getter: DocListViewOutputs#getSize())
int

2.4.2.3 Documents
Document instance holds the information about the each searched document. The table below describes the fields of Document.
Name Description Type
documentID The array of Document objects. Getter: Document#getDocumentID() String
title The title of the document.Getter: Document#getTitle() String
input The original text of the input document.
Getter: Document#getInput()
String
standardFeature
Elements
The array of standard feature elements.
Getter: Document#getStandardFeatureElements()
com.ibm.takmi.ext.StandardFeatureElement[]
keywordFeature
Elements
The array of keyword feature elements.
Getter: Document#getKeywordFeatureElements()
com.ibm.takmi.ext.KeywordFeatureElement[]

2.4.2.4 StandardFeatureElement and KeywordFeatureElement
Both StandardFeatureElement and KeywordFeatureElement hold an annotation given to a document. A StandardFeatureElement holds an annotation that exists before ICA preprocessing, and a KeywordFeatureElement holds an annotation that is added during the ICA preprocessing. The table below shows the fields of the two classes.
com.ibm.takmi.ext.StandardFeatureElement
Name Description Type
category The category path of the feature element.Getter: getCategory() com.ibm.takmi.ext.Category
value The value of the feature element.Getter: getValue() String

com.ibm.takmi.ext.KeywordFeatureElement
Name Description Type
category The category path of the feature element.Getter: getCategory() com.ibm.takmi.ext.Category
value The value of the feature element.Getter: getValue() String
begin The start index of the keyword occurrence. The index starts from 0.
Getter: getBegin()
int
end The end index of the keyword occurrence. The character at the end index is not contained by the occurrence.
Getter: getEnd()
int

2.4.2.5 Sample Code
The code below describes how to execute the DocListViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.Document;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.doclistview.DocListViewFunction;
import com.ibm.takmi.ext.doclistview.DocListViewInputs;
import com.ibm.takmi.ext.doclistview.DocListViewOutputs;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
  SearchQuery searchQuery = …;

  //Create instances of mining function, input and output
  DocListViewFunction dlvFunction = new DocListVIewFunction(miner);
  DocListViewInputs dlvInputs = new DocListViewInputs(searchQuery, 10, 20);
  DocListViewOutputs dlvOutputs = new DocListViewOutputs();

  //Execute the mining function
  dlvFunction.execute(dlvInputs, dlvOutputs);

  //Get Documents from output instance
  Document documents[] = dlvOutputs.getDocuments();

  //Loop thru the Document array
  for (int i=0; i<docs.length; i++) {
    //Print fields
    System.out.println("[Document ID: " + docs[i].getDocumentID() + "]");
    System.out.println("Title: " + docs[i].getTitle());
    System.out.println("Input: " + docs[i].getInput());

    //Print standard feature elements
    StandardFeatureElement sfe[] = docs[i].getStandardFeatureElements();
    for (int j=0; j<sfe.length; j++) {
      System.out.println("Category: " + sfe[j].getCategory().getName() + ", Value: " + sfe[j].getValue());
    };

    // Print keyword feature elements
    KeywordFeatureElement kfe[] = docs[i].getKeywordFeatureElements();
    for (int j=0; j<kfe.length; j++) {
      System.out.println("Category: " + kfe[j].getCategory().getName() + ", Keyword: " + kfe[j].getKeyword()
          + " [" + kfe[j].getBegin() + "-" + kfe[j].getEnd() + "]");
    }
  }
} catch (MinerException e) {
  // Do exception handling here
}


2.4.3 CategoryViewFunction
CategoryViewFunction returns the distribution of either keywords or subcategories for a category in the target document set.

2.4.3.1 Input Parameters
The input parameters for CategoryViewFunction must be stored in CategoryViewInputs instance. The table below describes the field of CategoryViewInputs.
Name Description Type
searchQuery
(optional)
Search condition to narrow down the target document set. If null is specified then the target is a set of all documents in the database. com.ibm.takmi.ext.search.SearchQuery
category The target category for keywords or subcategries. This must not be a null value. com.ibm.takmi.ext.Category
subcategoryFlag If true, CategoryViewFunction will return the distribution of subcategories for a target category. Otherwise, it will return that of keywords. boolean
sort The type of sort. Below are the valid values.
  • CategoryViewInputs.SORT_FREQ (by frequency)
  • CategoryViewInputs.SORT_CORR (by correlation)
  • CategoryViewInputs.SORT_ALPHA (alphabetical order)
String
maxLinesToDisplay The maximum number of keywords or subcategories in the result. Must be a positive number. int
Available Constructors:
  • CategoryViewInputs(Category category, boolean subcategoryFlag, String sort, int maxLinesToDisplay)
  • CategoryViewInputs(SearchQuery searchQuery, Category category, boolean subcategoryFlag, String sort, int maxLinesToDisplay)

2.4.3.2 Output Parameters
The output parameters for CategoryViewFunction is stored in CategoryViewOutputs instance. The table below describes the fields of CategoryViewOutputs.
Name Description Type
categories An array of subcategories. Valid only when subcategoryFlag in the input parameter is true, and a null value when it is false.
(Getter: CategoryViewOutputs#getCategories())
com.ibm.takmi.ext.Category[]
keywords An array of subcategories. Valid only when subcategoryFlag in the input parameter is true, and a null value when it is false.
(Getter: CategoryViewOutputs#getCategories())
String[]
freqs An array of frequencies in the document set.
(Getter: CategoryViewOutputs#getFreqs())
int[]
corrs An array of correlation values.
(Getter: CategoryViewOutputs#getCorrs())
double[]
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
(Getter: CategoryViewOutputs#getSize())
int

2.4.3.3 Sample Code
The code below describes how to execute the CategoryViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.Document;
import com.ibm.takmi.ext.Category;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.categoryview.CategorytViewFunction;
import com.ibm.takmi.ext.categoryview.CategoryViewInputs;
import com.ibm.takmi.ext.categoryview.CategoryViewOutputs;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
  SearchQuery searchQuery = …;

  // As for getting category, please refer to “Category API” chapter
  Category category = …;

  //Create instances of mining function, input and output
  CategoryViewFunction cvFunction = new CategoryVIewFunction(miner);
  CategoryViewInputs cvInputs =
  new CategoryViewInputs(searchQuery, category, true, CategoryViewInputs.SORT_FREQ, 10);
  CategoryViewOutputs cvOutputs = new CategoryViewOutputs();

  //Execute the mining function
  cvFunction.execute(cvInputs, cvOutputs);

  //Get results from output instance
  String categories[] = cvOutputs.getCategories();
  int freqs[] = cvOutputs.getFreqs();
  int corrs[] = cvOutputs.getCorrs();

} catch (MinerException e) {
  // Do exception handling here
}


2.4.4 TimeSeriesViewFunction
TimeSeriesViewFunction returns the frequency of documents in each period of time, for example each year or each day.

2.4.4.1 Input Parameters
The input parameters for TimeSeriesViewFunction must be stored in TimeSeriesViewInputs instance. The table below describes the field of TimeSeriesViewInputs.
Name Description Type
searchQuery
(optional)
Search condition to narrow down the target document set. If null is specified then the target is a set of all documents in the database. com.ibm.takmi.ext.search.SearchQuery
timeScale The time scale to group documents. Below are the valid values.
  • TimeSeriesViewInputs.TIME_YEAR
  • TimeSeriesViewInputs.TIME_HALF (half year)
  • TimeSeriesViewInputs.TIME_QUARTER (quarter year)
  • TimeSeriesViewInputs.TIME_MONTH
  • TimeSeriesViewInputs.TIME_WEEK
  • TimeSeriesViewInputs.TIME_DATE
  • TimeSeriesViewInputs.TIME_DAY_OF_WEEK
  • TimeSeriesViewInputs.TIME_DAY_OF_MONTH
String
sort The type of sort. Below are the valid values.
  • TimeSeriesViewInputs.SORT_ASC (ascending)
  • TimeSeriesViewInputs.SORT_DESC (descending)
String
Available Constructors:
  • TimeSeriesViewInputs(String timeScale, String sort)
  • TimeSeriesViewInputs(SearchQuery searchQuery, String timeScale, String sort)

2.4.4.2 Output Parameters
The output parameters for TimeSeriesViewFunction is stored in TimeSeriesViewOutputs instance. The table below describes the fields of TimeSeriesViewOutputs.
Name Description Type
timeScale The time scale used in the calculation.
(Getter: TimeSeriesViewOutputs#getTimeScale())
String
timeValues An array of time values. The format of time values depend on the timeScale in the input parameters. For detail, see “2.4.4.3 Time Values” section
(Getter: TimeSeriesViewOutputs#getTimeValues())
int[]
freqs An array of frequencies in the time values.
(Getter: TimeSeriesViewOutputs#getFreqs())
int[]
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
(Getter: TimeSeriesViewOutputs#getSize())
int

2.4.4.3 Time Values
The format of time values in the output parameters depends on the value of time scale specified in the input parameters. The table below describes the format of time value for each time scale.
Time Scale Value Format Example Complement
TYPE_YEAR YYYY 2006 -> 2006
TYPE_HALF YYYYH 1H of 2006 -> 20061 H = 1 or 2
TYPE_QUARTER YYYYQ 2Q of 2006 -> 20062 Q = 1. 2. 3 or 4
TYPE_MONTH YYYYMM May, 2006 -> 200605
TYPE_WEEK YYYYWW 20th week of 2006 -> 200620
TYPE_DATE YYYYMMDD May 4, 2006 -> 20060504
TYPE_DAYOFWEEK number Sunday -> 1 From 1 up to 7, 1 for Sunday and 7 for for Saturday
TYPE_DAYOFMONTH number 4th -> 4, 31th -> 31 From 1 up to 31

2.4.4.4 Sample Code
The code below describes how to execute the TimeSeriesViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.Document;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.timeseriesview.TimeSeriesViewFunction;
import com.ibm.takmi.ext.timeseriesview.TimeSeriesViewInputs;
import com.ibm.takmi.ext.timeseriesview.TimeSeriesViewOutputs;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
  SearchQuery searchQuery = …;

  //Create instances of mining function, input and output
  TimeSeriesViewFunction tsvFunction = new TimeSeriesVIewFunction(miner);
  TimeSeriesViewInputs tsvInputs = new TimeSeriesViewInputs(
  searchQuery, TimeSeriesViewInputs.TYPE_DATE, TimeSeriesViewInputs.SORT_ASC);
  TimeSeriesViewOutputs tsvOutputs = new TimeSeriesViewOutputs();

  //Execute the mining function
  tsvFunction.execute(tsvInputs, tsvOutputs);

  //Get results from output instance
  String timeValues[] = tsvOutputs.getTimeValues();
  Int freqs[] = tsvOutputs.getFreqs();
   ….
} catch (MinerException e) {
  // Do exception handling here
}


2.4.5 TopicViewFunction
TopicViewFunction works as CategoryViewFunction for many periods of time at a time. For each period of time, TopicViewFunction returns the frequencies of either keywords or subcategories, and the topic indicator values each of which shows how prominent the keyword or subcategory is in a certain period of time.

2.4.5.1 Input Parameters
The input parameters for TopicViewFunction must be stored in TopicViewInputs instance. The table below describes the field of TopicViewInputs.
Name Description Type
searchQuery
(optional)
Search condition to narrow down the target document set. If null is specified then the target is a set of all documents in the database. com.ibm.takmi.ext.search.SearchQuery
timeScale The time scale to group documents. Below are the valid values.
  • TopicViewInputs.TIME_YEAR
  • TopicViewInputs.TIME_HALF (half year)
  • TopicViewInputs.TIME_QUARTER (quarter year)
  • TopicViewInputs.TIME_MONTH
  • TopicViewInputs.TIME_WEEK
  • TopicViewInputs.TIME_DATE
  • TopicViewInputs.TIME_DAY_OF_WEEK
  • TopicViewInputs.TIME_DAY_OF_MONTH
String
category The target category for keywords or subcategories. This must not be a null value. com.ibm.takmi.ext.Category
subcategoryFlag If true, TopicViewFunction will return the distribution of subcategories for a target category. Otherwise, it will return that of keywords. boolean
sort The type of sort. Below are the valid values.
  • TopicViewInputs.SORT_FREQ (by frequency)
  • TopicViewInputs.SORT_ALPHA (alphabetical order)
String
maxLinesToDisplay The maximum number of keywords or subcategories in the result. Must be a positive number. int
Available Constructors:
  • TopicViewInputs(String timeScale, Category category, boolean subcategoryFlag, String sort, int maxLinesToDisplay)
  • TopicViewInputs(SearchQuery searchQuery, String timeScale, Category category, boolean subcategoryFlag, String sort, int maxLinesToDisplay)

2.4.5.2 Output Parameters
The output parameters for TopicViewFunction is stored in TopicViewOutputs instance. The table below describes the fields of TopicViewOutputs.
Name Description Type
verticalCategory The target category for keywords or subcategories.
(Getter: TopicViewOutputs#getVerticalCategory())
com.ibm.takmi.ext.Category
subcategories An array of subcategories. Valid only when subcategoryFlag in the input parameter is true, and a null value when it is false.
(Getter: TopicViewOutputs#getSubcategories())
com.ibm.takmi.ext.Category[]
keywords An array of keywords. Valid only when subcategoryFlag in the input parameter is false, and a null value when it is true.
(Getter: TopicViewOutputs#getKeywords())
String[]
verticalFreqs An array of frequencies for keywords or subcategories. (Getter: (Getter: TopicViewOutputs #getVerticalFreqs()) int[]
timeValues An array of time values. The format of time values depend on the timeScale in the input parameters. For detail, see “2.4.4.3 Time Values” section
(Getter: TopicViewOutputs#getTimeValues())
int[]
timeScale The time scale used in the calculation.
(Getter: TopicViewOutputs#getTimeScale())
String
timeFreqs An array of frequencies for the time values.
(Getter: TopicViewOutputs#getTimeFreqs())
int[]
freqMatrix A matrix in which every element represents the frequency of a keyword in a certain period of time.
(Getter: TopicViewOutputs#getFreqMatrix())
int[][]
topicIndicatorMatrix A matrix in which every element represents the topic indicator value for a subcategory/keyword and a certain period of time.
(Getter: TopicViewOutputs#getTopicIndicatorMatrix())
float[][]
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
(Getter: TopicViewOutputs#getSize())
int

2.4.5.3 Sample Code
The code below describes how to execute the TopicViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.Document;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.topicview.TopicViewFunction;
import com.ibm.takmi.ext.topicview.TopicViewInputs;
import com.ibm.takmi.ext.topicview.TopicViewOutputs;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
  SearchQuery searchQuery = …;

  // As for getting category, please refer to “Category API” chapter
  Category category = …;

  //Create instances of mining function, input and output
  TopicViewFunction tvFunction = new TopicVIewFunction(miner);
  TopicViewInputs tvInputs = new TopicViewInputs(
  searchQuery, TopicViewInputs.TYPE_DAYOFWEEK, category, true, TopicViewInputs.SORT_ALPHA, 10);
  TopicViewOutputs tvOutputs = new TopicViewOutputs();

  //Execute the mining function
  tvFunction.execute(tvInputs, tvOutputs);

  //Get results from output instance
  String categories[] = tvOutputs.getSubcategories();
  int timevalues[] = tvOutputs.getTimeValues();
  int freqs[][] = tvOutputs.getFreqMatrix();
  float topicInd[][] = tvOutputs.getTopicIndicatorMatrix();
  …
} catch (MinerException e) {
  // Do exception handling here
}


2.4.6 DeltaViewFunction
DeltaViewFunction returns the frequencies of either keywords or subcategories, and the alert indicator values each of which shows how prominent the keyword or subcategory is from the viewpoint of over-time changes.

2.4.6.1 Input Parameters
The input parameters for DeltaViewFunction must be stored in DeltaViewInputs instance. The table below describes the field of DeltaViewInputs.
Name Description Type
searchQuery
(optional)
Search condition to narrow down the target document set. If null is specified then the target is a set of all documents in the database. com.ibm.takmi.ext.search.SearchQuery
timeScale The time scale to group documents. Below are the valid values.
  • DeltaViewInputs.TIME_YEAR
  • DeltaViewInputs.TIME_MONTH
  • DeltaViewInputs.TIME_WEEK
  • DeltaViewInputs.TIME_DATE
String
category The target category for keywords or subcategories. This must not be a null value. com.ibm.takmi.ext.Category
subcategoryFlag If true, DeltaViewFunction will return the distribution of subcategories for a target category. Otherwise, it will return that of keywords. boolean
sort The type of sort. Below are the valid values.
  • DeltaViewInputs.SORT_FREQ (by frequency)
  • DeltaViewInputs.SORT_ALPHA (alphabetical order)
  • DeltaViewInputs.SORT_ALERT (by alert indication)
String
sortPivotTime The pivot time value for sorting alert indicator. This value is neglected either when the sort mode is not SORT_ALERT or when the given value does not exist in the time values. int
maxLinesToDisplay The maximum number of keywords or subcategories in the result. Must be a positive number. int
Available Constructors:
  • DeltaViewInputs(String timeScale, Category category, boolean subcategoryFlag, String sort, int sortPivotTIme, int maxLinesToDisplay)
  • DeltaViewInputs(SearchQuery searchQuery, String timeScale, Category category, boolean subcategoryFlag, String sort, int sortPivotTIme, int maxLinesToDisplay)

2.4.6.2 Output Parameters
The output parameters for DeltaViewFunction is stored in DeltaViewOutputs instance. The table below describes the fields of DeltaViewOutputs.
Name Description Type
verticalCategory The target category for keywords or subcategories.
(Getter: DeltaViewOutputs#getVerticalCategory())
com.ibm.takmi.ext.Category
subcategories An array of subcategories. Valid only when subcategoryFlag in the input parameter is true, and a null value when it is false.
(Getter: DeltaViewOutputs#getSubcategories())
com.ibm.takmi.ext.Category[]
keywords An array of keywords. Valid only when subcategoryFlag in the input parameter is false, and a null value when it is true.
(Getter: DeltaViewOutputs#getKeywords())
String[]
verticalFreqs An array of frequencies for keywords or subcategories.
(Getter: DeltaViewOutputs #getVerticalFreqs())
int[]
timeValues An array of time values. The format of time values depend on the timeScale in the input parameters. For detail, see “2.4.4.3 Time Values” section
(Getter: DeltaViewOutputs#getTimeValues())
int[]
timeScale The time scale used in the calculation.
(Getter: DeltaViewOutputs#getTimeScale())
String
timeFreqs An array of frequencies for the time values.
(Getter: DeltaViewOutputs#getTimeFreqs())
int[]
freqMatrix A matrix in which every element represents the frequency of a keyword in a certain period of time.
(Getter: DeltaViewOutputs#getFreqMatrix())
int[][]
alertIndicatorMatrix A matrix in which every element represents the alert indicator value for a subcategory/keyword and a certain period of time.
(Getter: DeltaViewOutputs#getAlertIndicatorMatrix())
float[][]
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
(Getter: DeltaViewOutputs#getSize())
int

2.4.6.3 Sample Code
The code below describes how to execute the DeltaViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.Document;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.deltaview.DeltaViewFunction;
import com.ibm.takmi.ext.deltaview.DeltaViewInputs;
import com.ibm.takmi.ext.deltaview.DeltaViewOutputs;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
  SearchQuery searchQuery = …;

  // As for getting category, please refer to “Category API” chapter
  Category category = …;

  //Create instances of mining function, input and output
  DeltaViewFunction dvFunction = new DeltaVIewFunction(miner);
  DeltaViewInputs dvInputs = new DeltaViewInputs(
  searchQuery, DeltaViewInputs.TYPE_WEEK, category, true, DeltaViewInputs.SORT_ALERT, 200601, 10);
  DeltaViewOutputs dvOutputs = new DeltaViewOutputs();

  //Execute the mining function
  dvFunction.execute(dvInputs, dvOutputs);

  //Get results from output instance
  String categories[] = dvOutputs.getSubcategories();
  int timevalues[] = dvOutputs.getTimeValues();
  int freqs[][] = dvOutputs.getFreqMatrix();
  float alertIndicatorMatrix[][] = dvOutputs.getAlertIndicatorMatrix();
  …
} catch (MinerException e) {
  // Do exception handling here
}


2.4.7 TwoDMapViewFunction
TwoDMapViewFunction returns a table that shows the correlation between keywords/subcategories belonging to the vertical category and keywords/subcategories belonging to the horizontal category.

2.4.7.1 Input Parameters
The input parameters for TwoDMapViewFunction must be stored in TwoDMapViewInputs instance. The table below describes the field of TwoDMapViewInputs.
Name Description Type
searchQuery
(optional)
Search condition to narrow down the target document set. If null is specified then the target is a set of all documents in the database. com.ibm.takmi.ext.search.SearchQuery
verticalCategory The vertical target category for keywords or subcategories. This must not be a null value. com.ibm.takmi.ext.Category
verticalSubcategory
Flag
If true, TwoDMapViewFunction will return a list of subcategories of the vertical target category. Otherwise, it will return that of keywords. boolean
verticalSort The type of vertical sort. Below are the valid values.
  • DeltaViewInputs.SORT_FREQ (by frequency)
  • DeltaViewInputs.SORT_ALPHA (alphabetical order)
String
verticalMaxLines
ToDisplay
The maximum number of vertical keywords or subcategories in the result. Must be a positive number. int
horizontalCategory The horizontal target category for keywords or subcategories. This must not be a null value. com.ibm.takmi.ext.Category
horizontalSubcategory
Flag
If true, TwoDMapViewFunction will return a list of subcategories of the horizontal target category. Otherwise, it will return that of keywords. boolean
horizontalSort The type of horizontal sort. Below are the valid values.
  • DeltaViewInputs.SORT_FREQ (by frequency)
  • DeltaViewInputs.SORT_ALPHA (alphabetical order)
String
horizontalMaxLines
ToDisplay
The maximum number of horizontal keywords or subcategories in the result. Must be a positive number. int
Available Constructors:
  • TwoDMapViewInputs(Category verticalCategory, boolean verticalSubcategoryFlag, String verticalSort, int verticalMaxLinesToDisplay, Category horizontalCategory, boolean horizontalSubcategoryFlag, String horizontalSort, int horizontalMaxLinesToDisplay)
  • TwoDMapViewInputs(SearchQuery searchQuery, Category verticalCategory, boolean verticalSubcategoryFlag, String verticalSort, int verticalMaxLinesToDisplay, Category horizontalCategory, boolean horizontalSubcategoryFlag, String horizontalSort, int horizontalMaxLinesToDisplay)

2.4.7.2 Output Parameters
The output parameters for TwoDMapViewFunction is stored in TwoDMapViewOutputs instance. The table below describes the fields of TwoDMapViewOutputs.
Name Description Type
verticalSubcategories An array of vertical subcategories. Valid only when verticalSubcategoryFlag in the input parameter is true, and a null value when it is false.
(Getter: TwoDMapViewOutputs#getVerticalSubcategories())
com.ibm.takmi.ext.Category[]
verticalKeywords An array of vertical keywords. Valid only when verticalSubcategoryFlag in the input parameter is false, and a null value when it is true.
(Getter: TwoDMapViewOutputs#getVerticalKeywords())
String[]
verticalFreqs An array of frequencies for vertical keywords/subcategories. (Getter: TwoDMapViewOutputs #getVerticalFreqs()) int[]
horizontalSubcategories An array of horizontal subcategories. Valid only when horizontalSubcategoryFlag in the input parameter is true, and a null value when it is false.
(Getter: TwoDMapViewOutputs#getHorizontalSubcategories())
com.ibm.takmi.ext.Category[]
horizontalKeywords An array of horizontal keywords. Valid only when horizontalSubcategoryFlag in the input parameter is false, and a null value when it is true.
(Getter: TwoDMapViewOutputs#getHorizontalKeywords())
String[]
horizontalFreqs An array of frequencies for horizontal keywords/subcategories. (Getter: TwoDMapViewOutputs #getHorizontalFreqs()) int[]
freqMatrix A matrix in which every element represents the frequency of a pair of a vertical keyword/subcategory and a horizontal keyword/subcategory.
(Getter: TwoDMapViewOutputs#getFreqMatrix())
int[][]
corrMatrix A matrix in which every element represents the correlation value of a pair of vertical keyword/subcategory and a horizontal keyword/subcategory.
(Getter: TwoDMapViewOutputs#getAlertIndicatorMatrix())
float[][]
searchQuery The search query with the frequency being set in each search condition node. com.ibm.takmi.ext.search.SearchQuery
size The number of documents that meets the SearchQuery.
(Getter: TwoDMapViewOutputs#getSize())
int

2.4.7.3 Sample Code
The code below describes how to execute the TwoDMapViewFunction.
import com.ibm.takmi.ext.TextMiner;
import com.ibm.takmi.ext.Document;
import com.ibm.takmi.ext.search.SearchQuery;
import com.ibm.takmi.ext.twodmapview.TwoDMapViewFunction;
import com.ibm.takmi.ext.twodmapview.TwoDMapViewInputs;
import com.ibm.takmi.ext.twodmapview.TwoDMapViewOutputs;
:
(snip)
:
try {
  // As for initialization of TextMiner, please refer to the “Database API” chapter.
  TextMiner miner = …;

  // As for getting and filling SearchQuery instance, please refer to “Search API” chapter
   SearchQuery searchQuery = …;

  // As for getting category, please refer to “Category API” chapter
  Category verticalCategory = …;
  Category horizontalCategory = …;

  //Create instances of mining function, input and output
  TwoDMapViewFunction tdmvFunction = new TwoDMapVIewFunction(miner);
  TwoDMapViewInputs tdmvInputs = new TwoDMapViewInputs(searchQuery,
  verticalCategory, true, TwoDMapViewInputs.SORT_FREQ, 10,
  horizontalCategory, false, TwoDMapViewInputs.SORT_ALPHA, 20);
  TwoDMapViewOutputs tdmvOutputs = new TwoDMapViewOutputs();

  //Execute the mining function
  tdmvFunction.execute(tdmvInputs, tdmvOutputs);

  //Get results from output instance
   Category verticalSubcategories[] = tdmvOutputs.getVerticalSubcategories();
  String horizontalKeywords[] = tdmvOutputs.getHorizontalKeywords();
  int freqMatrix[][] = tdmvOutputs.getFreqMatrix();
  float corrMatrix[][] = tdmvOutputs.getCorrMatrix();
   …
} catch (MinerException e) {
  // Do exception handling here
}


Terms of Use
Notices
This information was developed for products and services offered in the U.S.A.

IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to:

IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A. 
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to:

IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106-0032, Japan 
The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.

Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact:

IBM Corporation
Silicon Valley Lab
Building 090/H-410
555 Bailey Avenue
San Jose, CA 95141-1003
U.S.A.
Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee.

The licensed program described in this document and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement or any equivalent agreement between us.

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only.

This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.

Copyright License
This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.

Trademarks
This topic lists IBM trademarks and certain non-IBM trademarks.

See http://www.ibm.com/legal/copytrade.shtml for information about IBM trademarks.

The following terms are trademarks or registered trademarks of other companies:

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

Intel, Intel Inside (logos), MMX and Pentium are trademarks of Intel Corporation in the United States, other countries, or both.

UNIX is a registered trademark of The Open Group in the United States and other countries.

Linux is a trademark of Linus Torvalds in the United States, other countries, or both.

Other company, product or service names might be trademarks or service marks of others.