Codota Logo
LexicalSemanticResource$LexicalRelation
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
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;
}
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)) {
de.tudarmstadt.ukp.dkpro.lexsemresourceLexicalSemanticResource$LexicalRelation

Javadoc

Supported lexical relation types.

Most used methods

  • equals

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Collectors (java.util.stream)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now