java.lang.Object
|
+----com.phrasys.phraser.Phraser
The typical way of using this class would be to register it as a WordListener to a parts-of-speech tagger, and to have another WordListener listen to its output. Phrase mark-up is emitted in the form of tags like <phrase type="NP"> and can be read out as a WordEvent.
The component relies on word class labels which have to be assigned to each word; these should be stored under the label "pos" in the incoming WordEvents.
Phraser()
addWordListener(WordListener)
getItem(int)
getNetwork()
hasMoreData(int)
matchArc(int, String)
recognisePhrases()
removeWordListener(WordListener)
setNetwork(String)
wordReceived(WordEvent)
Phraserpublic Phraser()
setNetworkpublic void setNetwork(java.lang.String filename) throws java.io.IOException
filename - the filename of the network file.
getNetworkpublic java.lang.String getNetwork()
hasMoreDatapublic boolean hasMoreData(int position)
position - the position in the sentence to test.
matchArc
public boolean matchArc(int position,
java.lang.String label)
position - the starting position in the sentence.
getItempublic java.lang.String getItem(int position)
position - the position to get.
recognisePhrasespublic void recognisePhrases()
addWordListenerpublic void addWordListener(WordListener listener)
listener - the listener to add.
removeWordListenerpublic void removeWordListener(WordListener listener)
listener - the listener to add.
wordReceivedpublic void wordReceived(WordEvent event)
event - the WordEvent that has been received.