agents
Class KnowledgeGatherAgent

java.lang.Object
  extended by agents.AgentFormat
      extended by agents.KnowledgeGatherAgent
All Implemented Interfaces:
java.lang.Runnable

public class KnowledgeGatherAgent
extends AgentFormat

KnowledgeGatherAgent uses a settings file to identify key-sentences in text and recognize the knowledge there. The settings file can possibly contain settings for multiple languages, but only one language will be kept in memory at once. When KnowledgeGatherAgent identifies knowledge in the text, it will create an output. The output contains information on what kind of knowledge has been identified, what sentences to use to verify it and what the newly discovered word is. The key-sentences will be ordered so that the longest sentences, in terms of number of words, will be first of the sentences. This makes it possible to search for the longest and hardest-to-match sentences first, and to remove those matches from the text, before the search for the shorter and easier-to-match sentences begins. Often the shorter sentences will be a substring of the longer sentences, and therefor it is important to remove the longer sentences first. This agent takes 2 inputs and one output. The first input is where KnowledgeGatherAgent receives text that should be searched for knowledge. The second input is the language-input. When a new language is set, that information should be sent to the second variable. The output variable contains the knowledge found, the sentences to use to verify it and the new word to use in search of further knowledge.

Author:
Håvard Rykkelid

Field Summary
private static java.lang.String agentSettings
           
private static java.lang.String language
           
private static java.lang.String[] numberIdent
           
private static java.lang.String[][] searchKeys
           
private static java.util.Vector<KeySentenceBean> sentences
           
 
Fields inherited from class agents.AgentFormat
input, output
 
Constructor Summary
KnowledgeGatherAgent()
           
 
Method Summary
private  void initiateAgent()
          This method initiates the variables of KnowledgeGatherAgent.
private  boolean isaNumber(java.lang.String string)
          This method checks whether the input-string symbolizes a number or not.
 void run()
          This method will be run when the Thread containing this agentdescription is started
 
Methods inherited from class agents.AgentFormat
init, outputAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sentences

private static java.util.Vector<KeySentenceBean> sentences

agentSettings

private static final java.lang.String agentSettings

language

private static java.lang.String language

numberIdent

private static java.lang.String[] numberIdent

searchKeys

private static java.lang.String[][] searchKeys
Constructor Detail

KnowledgeGatherAgent

public KnowledgeGatherAgent()
Method Detail

run

public void run()
This method will be run when the Thread containing this agentdescription is started


isaNumber

private boolean isaNumber(java.lang.String string)
This method checks whether the input-string symbolizes a number or not. The input-string can contain numbers in numbers-format or text-format. Recognition of numbers in text-format relies on language-specific information from the settings-file.

Parameters:
string - - the String to check
Returns:
true if the String was a number

initiateAgent

private void initiateAgent()
This method initiates the variables of KnowledgeGatherAgent. It reads information from the settingsfile. All the information is language-specific, and the agent will only fetch information relevant to the current language. The elements of information fetched are: How to identify numbers in this language, how to verify knowledge in this language and how to identify knowledge in this language.