public class PartOfSpeechImpl extends java.lang.Object implements PartOfSpeech
PartOfSpeech that reads the info
from a file. The format of the file is as follows:
word pos word pos word pos ...Where
word is the word and pos is the
part of speech for the word. The part of speech is implementation
dependent.| Constructor and Description |
|---|
PartOfSpeechImpl(java.net.URL url,
java.lang.String defaultPartOfSpeech)
Creates a new PartOfSpeechImpl by reading from the given URL.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPartOfSpeech(java.lang.String word)
Returns a description of the part of speech given a word.
|
public PartOfSpeechImpl(java.net.URL url,
java.lang.String defaultPartOfSpeech)
throws java.io.IOException
url - the input sourcedefaultPartOfSpeech - the default part of speechjava.io.IOException - if an error occurspublic java.lang.String getPartOfSpeech(java.lang.String word)
defaultPartOfSpeech parameter passed to the constructor.getPartOfSpeech in interface PartOfSpeechword - the word to classify