Example of a sense with subsenses

25 views
Skip to first unread message

Tristan Miller

unread,
Apr 17, 2012, 11:27:46 AM4/17/12
to uby-...@googlegroups.com
Greetings.

The API that the class Sense offers a method getSenses(). From the Uby LMF
model at <http://www.ukp.tu-darmstadt.de/data/uby/uby-lmf/> I take it this
is by design. But from doing some queries on the Uby resource so far I
haven't been able to find any Sense s such that s.getSenses() != null. I
was wondering if any such senses exist, or if this functionality is just
something that's been reserved for future use?

That is, for the following method, is there any value of the parameter word
such that the method prints something?

public static void listSubsenses(Uby uby, String word)
{
List<LexicalEntry> lexicalEntries = uby.getLexicalEntries(word,
null, null);
for (LexicalEntry lexicalEntry : lexicalEntries) {
for (Sense s : lexicalEntry.getSenses()) {
List<Sense> subsenses = s.getSenses();
if (subsenses != null) {
for (Sense t : s.getSenses()) {
System.out.println("Sense " + s.getId()
+ " has subsense " + t.getId());
}
}
}
}
}

Regards,
Tristan

--
Tristan Miller, Doctoral Researcher | Tel: +49 6151 16 6166
Ubiquitous Knowledge Processing Lab | Fax: +49 6151 16 5455
Department of Computer Science | mil...@ukp.informatik.tu-darmstadt.de
Technische Universität Darmstadt | http://www.ukp.tu-darmstadt.de/

signature.asc

Michael Matuschek

unread,
Apr 18, 2012, 8:17:13 AM4/18/12
to uby-...@googlegroups.com
No, currently there are no senses for which this method returns anything other than null. However, in case we include a resource in the future which supports the concept of subsenses, this method will become meaningful. I added a comment to clarify that this method is useless right now.

- Michael
Reply all
Reply to author
Forward
0 new messages