Class com.phrasys.FilePhraser
java.lang.Object
|
+----com.phrasys.FilePhraser
- public class FilePhraser
- extends java.lang.Object
- implements WordListener
This class combines a LineReader, a Sentencer,
a Tokeniser, a Tagger, and a Phraser.
It fully tokenises and tags an input file and also recognises
phrases in it.
- Version:
- 1.0 (18/11/00)
- Author:
- Oliver Mason
FilePhraser(String)
- Constructor.
addWordListener(WordListener)
- Add a WordListener.
main(String[])
- Run as stand-alone application.
removeWordListener(WordListener)
- Remove a WordListener.
start()
- Start off the whole process.
wordReceived(WordEvent)
- Receive a WordEvent.
FilePhraser
public FilePhraser(java.lang.String file)
Constructor.
- Parameters:
file - the name of the file to be processed.
addWordListener
public void addWordListener(WordListener listener)
Add a WordListener.
- Parameters:
listener - the listener.
- See Also:
- WordListener
removeWordListener
public void removeWordListener(WordListener listener)
Remove a WordListener.
- Parameters:
listener - the listener to remove.
- See Also:
- WordListener
start
public void start() throws java.io.FileNotFoundException
Start off the whole process.
- Throws:
- FileNotFoundException. -
wordReceived
public void wordReceived(WordEvent event)
Receive a WordEvent.
In order to function as a stand-alone program, the FilePhraser
implements the WordListener interface and can receive its own
WordEvents. Here they are simply printed to System.out,
with one word/token per line.
- Parameters:
event - a WordEvent.
main
public static final void main(java.lang.String args[]) throws java.io.FileNotFoundException
Run as stand-alone application.
- Parameters:
args - a list of filenames to be tokenised.