/** * Fetches a {@link List} of {@link LexicalEntry} instances which written representation is the * specified word. * * Optionally lexical entries can be filtered by part-of-speech and a {@link Lexicon}. * * @param word * the written representation of the lexical entries to be fetched * @param lexicon * If not null, filters lexical entries by the specified lexicon. Note that the * Lexicon instance has to be obtained beforehand. * @return A list of lexical entries matching the specified criteria. If no lexical entry * matches the specified criteria, this method returns an empty list. * @see LexicalEntry#getLemma() */ public List<LexicalEntry> getLexicalEntries(String word, Lexicon lexicon) { return getLexicalEntries(word, null, lexicon); }
private String getSemanticField(String semanticLabelValue) { // get the semantic field of a semantic label value of type "domain" String semanticField = "UNKNOWN"; if (!uby.getLexicalEntries(semanticLabelValue,null,wordnet).isEmpty()) { List<LexicalEntry> lexicalEntries = uby.getLexicalEntries(semanticLabelValue,null,wordnet); Sense sense = getWordnetSense(lexicalEntries); semanticField = getSemanticField(sense); } return semanticField; }
if (uby.getLexicalEntries(lemmaString,null,null).isEmpty()) { return "UNKNOWN"; } else { // there is at least one UBY lexicon that contains the multiword as lemma if (!uby.getLexicalEntries(lemmaString,null,wordnet).isEmpty()) { List<LexicalEntry> lexicalEntries = uby.getLexicalEntries(lemmaString,null,wordnet); Sense sense = getWordnetSense(lexicalEntries); return getSemanticField(sense); List<LexicalEntry> lexicalEntries = uby.getLexicalEntries(lemmaString,null,null); String otherSemanticLabelValue = getOtherSemanticLabelValue(lexicalEntries); return getSemanticField(otherSemanticLabelValue);
return "UNKNOWN"; } else if (uby.getLexicalEntries(token.getLemma().getValue(),null,null).isEmpty()) { return "UNKNOWN"; } else { // there is at least one UBY lexicon that contains the lemma for (EPartOfSpeech pos : corePosToUbyPos(token.getPos().getType().getShortName())) { if (!uby.getLexicalEntries(token.getLemma().getValue(),pos,wordnet).isEmpty()) { List<LexicalEntry> lexicalEntries = uby.getLexicalEntries(token.getLemma().getValue(),pos,wordnet); Sense sense = getWordnetSense(lexicalEntries); return getSemanticField(sense); List<LexicalEntry> lexicalEntries = uby.getLexicalEntries(token.getLemma().getValue(),null,null); String otherSemanticLabelValue = getOtherSemanticLabelValue(lexicalEntries); return getSemanticField(otherSemanticLabelValue);
token.getPos().getType().getShortName().equals("ADJ")) && !auxiliariesAndModals.contains(token.getLemma().getValue())) { mfs = getMostFrequentSense(uby.getLexicalEntries(token.getLemma().getValue(), null, null)); String syntacticBehaviour = getSyntacticBehaviour(token.getPos().getType().getShortName(),uby.getLexicalEntries(token.getLemma().getValue(), EPartOfSpeech.verb, null)); List<SemanticField> semanticFieldAnnotations = JCasUtil.selectCovering(jcas,