agents
Class FilterAgent

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

public class FilterAgent
extends AgentFormat

This agent is responsible for filtering away unwanted words and symbols from a text. The words that are unwanted are defined in an xml file and are language-dependent. This class uses the class TreeNode to help storing definitions of unwanted words, and to facilitate efficient checking of words if they are unwanted or not. This agent takes 2 inputs and one output. The first input is where FilterAgent receives unfiltered text that should be filtered. 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 ready filtered text.

Author:
Håvard Rykkelid

Field Summary
private static java.lang.String agentSettings
           
private static java.lang.String[] general
           
private static java.lang.String language
           
private static TreeNode root
           
 
Fields inherited from class agents.AgentFormat
input, output
 
Constructor Summary
FilterAgent()
           
 
Method Summary
private  void initiateFilter()
          This method initiates the filter of FilterAgent based on the contents of the file and the language.
 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

agentSettings

private static final java.lang.String agentSettings

language

private static java.lang.String language

root

private static TreeNode root

general

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

FilterAgent

public FilterAgent()
Method Detail

run

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


initiateFilter

private void initiateFilter()
This method initiates the filter of FilterAgent based on the contents of the file and the language. FilterAgent uses TreeNode to build information about what words to exclude, and to efficiently check words afterwards.