gr.demokritos.iit.jinsect.structs
Class Dictionary

java.lang.Object
  extended by gr.demokritos.iit.jinsect.structs.Dictionary
All Implemented Interfaces:
java.io.Serializable

public class Dictionary
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
 boolean AddSubStrings
           
 java.lang.String Name
           
 boolean RemoveSubStrings
           
 
Constructor Summary
Dictionary(java.lang.String sName, int iMaxWordSize)
          Creates a new instance of Dictionary
 
Method Summary
 void addText(java.lang.String sText)
          Adds all words of a selected text to the list of definitions.
 void addWord(java.lang.String sWord)
          Adds a word, creating the corresponding definition, to the dictionary.
 void addWordDef(WordDefinition wdDef)
           
 void clear()
           
 boolean contains(java.lang.String sWord)
           
 int length()
           
 void loadFromFile(java.lang.String sFileName)
          Loads a text file with filename sFilename and adds all its words to the definitions
 void removeText(java.lang.String sText)
           
 void removeWord(java.lang.String sWord)
          Removes word sWord without removing substrings.
 void removeWord(java.lang.String sWord, boolean bRemoveSubStrings)
           
 void removeWordDef(WordDefinition wdDef)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Name

public java.lang.String Name

AddSubStrings

public boolean AddSubStrings

RemoveSubStrings

public boolean RemoveSubStrings
Constructor Detail

Dictionary

public Dictionary(java.lang.String sName,
                  int iMaxWordSize)
Creates a new instance of Dictionary

Method Detail

length

public int length()

size

public int size()

addWord

public void addWord(java.lang.String sWord)
Adds a word, creating the corresponding definition, to the dictionary. Also adds substrings.

Parameters:
sWord - The word to add

removeWord

public void removeWord(java.lang.String sWord)
Removes word sWord without removing substrings.

Parameters:
sWord - The word to remove

removeWord

public void removeWord(java.lang.String sWord,
                       boolean bRemoveSubStrings)

loadFromFile

public void loadFromFile(java.lang.String sFileName)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Loads a text file with filename sFilename and adds all its words to the definitions

Parameters:
sFileName - The name of the file to open.
Throws:
java.io.FileNotFoundException
java.io.IOException

addText

public void addText(java.lang.String sText)
Adds all words of a selected text to the list of definitions.

Parameters:
sText - The input text.

removeText

public void removeText(java.lang.String sText)

addWordDef

public void addWordDef(WordDefinition wdDef)

removeWordDef

public void removeWordDef(WordDefinition wdDef)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clear

public void clear()

contains

public boolean contains(java.lang.String sWord)