Tabnine Logo
LexicalSemanticResource$LexicalRelation
Code IndexAdd Tabnine to your IDE (free)

How to use
LexicalSemanticResource$LexicalRelation
in
de.tudarmstadt.ukp.dkpro.lexsemresource

Best Java code snippets using de.tudarmstadt.ukp.dkpro.lexsemresource.LexicalSemanticResource$LexicalRelation (Showing top 4 results out of 315)

origin: de.tudarmstadt.ukp.dkpro.lexsemresource/de.tudarmstadt.ukp.dkpro.lexsemresource.wikipedia-asl

public Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation) throws LexicalSemanticResourceException {
  Entity entity = WikipediaArticleUtils.lexemeToEntity(wiki, lexeme, isCaseSensitive);
  Set<String> relatedLexemes = new HashSet<String>();
  if (entity == null) {
    return relatedLexemes;
  }
  if (lexicalRelation.equals(LexicalRelation.antonymy)) {
    logger.warn("Wikipedia contains no antonymy information. Returning empty set.");
  }
  else if (lexicalRelation.equals(LexicalRelation.synonymy)) {
    for (String synonym : entity.getLexemes()) {
      String plainSynonym = WikipediaArticleUtils.plainString(synonym);
      if (!plainSynonym.equals(lexeme)) {
        relatedLexemes.add(plainSynonym);
      }
    }
  }
  return relatedLexemes;
}
origin: de.tudarmstadt.ukp.dkpro.lexsemresource/de.tudarmstadt.ukp.dkpro.lexsemresource.wordnet-asl

if (lexicalRelation.equals(LexicalRelation.synonymy)) {
origin: de.tudarmstadt.ukp.dkpro.lexsemresource/de.tudarmstadt.ukp.dkpro.lexsemresource.wiktionary-asl

public Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation) throws LexicalSemanticResourceException {
  Map<String,String> lexemeMap = new HashMap<String,String>();
  lexemeMap.put(lexeme, sense);
  Entity entity = this.getEntity(lexemeMap, pos);
  if (entity == null) {
    return Collections.emptySet();
  }
  Set<String> relatedWords = new HashSet<String>();
  Set<WordEntry> words = WiktionaryUtils.entityToWords(wkt, entity);
  for (WordEntry word : words) {
    if (lexicalRelation.equals(LexicalRelation.antonymy)) {
      relatedWords.addAll(word.getAllRelatedWords(RelationType.ANTONYM));
    }
    else if (lexicalRelation.equals(LexicalRelation.synonymy)) {
      relatedWords.addAll(word.getAllRelatedWords(RelationType.SYNONYM));
    }
  }
  return relatedWords;
}
origin: de.tudarmstadt.ukp.dkpro.lexsemresource/de.tudarmstadt.ukp.dkpro.lexsemresource.wordnet-asl

private PointerTargetNodeList getNodeListByRelation(Synset synset, LexicalRelation lexicalRelation) throws LexicalSemanticResourceException {
  try {
    if (lexicalRelation.equals(LexicalRelation.antonymy)) {
      return PointerUtils.getAntonyms(synset);
    }
    else if (lexicalRelation.equals(LexicalRelation.synonymy)) {
      return PointerUtils.getSynonyms(synset);
    }
  } catch (NullPointerException e) {
    // silently catch that - I do not know why JWNL throws that exception here
  } catch (JWNLException e) {
    throw new LexicalSemanticResourceException(e);
  }
  return null;
}
de.tudarmstadt.ukp.dkpro.lexsemresourceLexicalSemanticResource$LexicalRelation

Javadoc

Supported lexical relation types.

Most used methods

  • equals

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now