Submitted by spenagon on Tue, 06/21/2016 - 12:20

I am using the API of Freeling 4 and I am interested in extract some terms detected by the multiwords module. These terms are verbs and I need the morpho and POS to extract the lemmas and so the multiwords detect all the verbal forms. But when I use the method found_in_dict of the word it gives me more words than those detected by multiwords. Can I reset the value of found_in_dict?, or how can I know the word detected only by the multiwords module?.


pd. Link or Technical reference is broken:

I fixed the link to reference Manual, thanks for pointing it out

I am not sure to understand what is the problem.
Some hints that may help you:

  • The flag "found_in_dict" is activated for words found in the dictionary, not for multiwords.
  • To find out whether a word is a multiword, you can use word::is_multiword()
    (though that will be also true for other multiwords such as numbers, dates, or NEs)
  • To find out whether a word has been analyzed by a module, you can use word::get_n_analysis(). If a word has less analysis before going into a module than afterwards, it means that module added some analysis.
  • You can reset found_in_dict with method word::set_found_in_dict(bool)

Well, I have tried to reset "found_in_dict" with the java api but I have not achieved it. I extract words from a sentence with a iterator , then I have an object Word that I can set found_in_dict to false but, how can I put this object word in the sentence?. I don't see a method setWords in the object sentence.

Sentence iterators should provide references to words in the sentece.
So, if you call a method of class word via an iterator, you should be modifying the sentence word, not a copy.