Reputation: 11
I want to impose forced POS tagging of particular words in a French sentence.
How can I do that through code?
In the code below, I want to force tag précédent as Verb, but I am not able to do so.
Example:
String input = "Le jour précédent/VB";
MaxentTagger tagger = new MaxentTagger("french.tagger");
List<List<HasWord>> sentences = MaxentTagger.tokenizeText(newStringReader(input));
for (List<HasWord> sentence : sentences) {
List<TaggedWord> tSentence = tagger.tagSentence(sentence);
}
Upvotes: 1
Views: 300
Reputation: 470
(Sorry, I don't have 50 reputation for comment!) It seems easier to do with RDRPOSTagger. RDRPOSTagger also supports pre-trained models for French POS and morphological tagging.
Upvotes: 1