|
From: Sebastian K. <seb...@gm...> - 2008-07-31 10:25:25
|
Hi Adam, thanks for interesting questions. 1) I forgot to implement POS support at the start. It is done now. You can use getPOS() methods in Synset and WordSense. In both cases they return object from PartOfSpeech enumeration. 2) ThesaurusStorage::search returns Collection<KOSEntry> not Collection<ThesaurusEntry> since it is implemented by KOSStorage for the unification reasons. A very good example on how to use search can be found in (JOnto webapp) servlets. ThesaurusStorage .getInstance ().search(com.kh.jonto.openthesaurus.pl.OTContext.getContext(), "label:"+word+" AND (type:synset OR type:tag)"); This comes from WordNetServlet and allows to find only thesaurus entries and tags with given label. Compare it with ThesaurusStorage .getInstance ().search(com.kh.jonto.openthesaurus.pl.OTContext.getContext(), "label:"+word) where you look for ANY KOS entry with given label The first will return objects of type org.corrib.jonto.wordnet.Synset (see below, !unless the index is broken!), the second with return objects of various types. INFO: FT Query: label:computer AND (type:synset OR type:tag) -> +label:computer +(type:synset type:tag) http://www.w3.org/2006/03/wn/wn20/instances/synset-analog_computer-noun-1 -> class org.corrib.jonto.wordnet.Synset http://www.w3.org/2006/03/wn/wn20/instances/synset-briefcase_computer-noun-1 -> class org.corrib.jonto.wordnet.Synset ..... more 2008-07-31 12:07:06 org.corrib.jonto.index.FulltextIndex find INFO: FT Query: label:computer -> label:computer # http://www.w3.org/2006/03/wn/wn20/instances/wordsense-computer_memory-noun-1 -> class org.corrib.jonto.wordnet.WordSense # http://www.w3.org/2006/03/wn/wn20/instances/word-computer_store -> class org.corrib.jonto.wordnet.Word # http://www.w3.org/2006/03/wn/wn20/instances/word-computer_error -> class org.corrib.jonto.wordnet.Word # http://www.w3.org/2006/03/wn/wn20/instances/synset-computer_circuit-noun-1 -> class org.corrib.jonto.wordnet.Synset ..... more 3) TaxonomyEntry inheritates from KOSContext and it is not possible to override returned type of from methods like getContext(). We could try fiddle with fancy Java5 features - but the code would be come very messy. I hope this answers your questions. Cheers, Sebastian On Jul 30, 2008, at 23:02 , Adam Gzella wrote: > Robie to i nasuwa się kilka pytań. > 1. Jak dostać się do części mowy w przypadku WN. > - robiłem to tak: getWordSense().getPOS().getLabel() > - czy takie coś da ten sam wynik?: > Word word = new Word((WordNetContext)wne.getContext(),wne.getURI()); > wordNetConcept.put("type",word.getLexicalForm()); > > 2.ThesaurusStorage.getInstance().search zwraca kolekcję KOSEntry. > Dlaczego nie Collection<ThesaurusEntry> ? > > czy bezpieczne jest rzutowanie ThesaourusEntry cos = > (ThesaurusEntry)cosKosEntry; > > Chciałbym to zastosować w powyższym (gdzie wiadomo, że obiekt będzie > ThesaurusEntry), i w kilku innych miejscach. > > 3. podobne do powyższego - czy TaxonomyEntry nie mogło by zwracać > TaxonomyContext a nie KOSContext. (choć to raczej nie przeszkadza) > > > > -- > _/_/ Regards, Adam Gzella _/ > _/ > _/_/ Digital Enterprise Research Institute, NUI Galway Ireland _/_/ > _/_/ e-mail/Jabber: adam dot gzella at gmail dot com _/_/ > _/_/ gg: 1998783, skype: adameqq _/_/ |