A ULPartOfSpeechTagger marks the words in a sentence with parts of speech. The tagger uses a combination of dictionary look-up and rule-based ambiguity resolution to choose parts of speech for each word in the sentence.
More...
#include <ulpartofspeechtagger.h>
A ULPartOfSpeechTagger marks the words in a sentence with parts of speech. The tagger uses a combination of dictionary look-up and rule-based ambiguity resolution to choose parts of speech for each word in the sentence.
ULPartOfSpeechTagger::ULPartOfSpeechTagger |
( |
| ) |
|
ULPartOfSpeechTagger::~ULPartOfSpeechTagger |
( |
| ) |
|
|
virtual |
void ULPartOfSpeechTagger::clear |
( |
| ) |
|
Sets this tagger to its default state.
- Parameters
-
[out] | serviceList | Used to return a list of all the services this ULWorker can provide. |
Implements ULWorker.
- Returns
- a pointer to the ULDissector used by this tagger.
const ULLanguage & ULPartOfSpeechTagger::getLanguage |
( |
| ) |
const |
- Returns
- the language associated with this tagger.
Computes part of speech tags for the words in the specified sentence. These tags are returned in the form of a list of ULTaggedWord objects. Each ULTaggedWord object represents the list of possible interpretations of a word from the sentence, ordered by decreasing likelihood. For example, in the sentence "Alice drinks coffee", the most likely interpretation of the word "drinks" would be as the third-person singular form of the verb "to drink". The word "drinks" also has a less likely (in this sentence) interpretation as the plural of the noun "drink". Thus, the ULTaggedWord corresponding to "drinks" in the context of the sentence "Alice drinks coffee" would have two elements, first the verb and second the noun.
- Returns
- ULError::NoError if the tagging is successful, or some other ULError value otherwise.
- Parameters
-
[in] | sentence | The sentence to be tagged. |
[out] | taggedWords | The resulting list of tagged words. |
Computes part of speech tags for the words in the specified sentence. These tags are returned in the form of a list of ULDerivation objects. Each ULDerivation corresponds to a single word from the sentence, and identifies the word's surface form, root word, part of speech category, and other word feature information (e.g. the tense and person for a verb).
This version of getTags is provided as a simpler version of the getTags that returns a list of ULTaggedWords. For most applications, knowing the most likely part of speech of a word in a sentence (as opposed to an ordered list of possible parts of speech) will be sufficient.
- Returns
- ULError::NoError if the tagging is successful, or some other ULError value otherwise.
- Parameters
-
[in] | sentence | The sentence to be tagged. |
[out] | tags | The resulting word list. |
- Returns
- true if the specified service can be performed by this ULWorker, and false otherwise.
- Parameters
-
service | The desired service. |
Implements ULWorker.
void ULPartOfSpeechTagger::setDissector |
( |
ULDissector * |
newDissector | ) |
|
Assigns a ULDissector to be used by this tagger. The ULPartOfSpeechTagger does not take responsibility for deleting the data source. That will need to happen elsewhere (typically the ULFactory will take care of it if your application uses ULFactory to instantiate data sources and workers).
- Parameters
-
[in] | newDissector | A pointer to the desired dissector. |
The documentation for this class was generated from the following files: