Codota Logo
Uby
Code IndexAdd Codota to your IDE (free)

How to use
Uby
in
de.tudarmstadt.ukp.lmf.api

Best Java code snippets using de.tudarmstadt.ukp.lmf.api.Uby (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.lmf.api-asl

/**
 * 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);
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.lmf.api-asl

/**
 * Returns an {@link Iterator} over {@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 lexicon
 *            If not null, filters lexical entries by the specified lexicon. Note that the
 *            Lexicon instance has to be obtained beforehand.
 * @return An Iterator over lexical entries matching the specified criteria
 *
 * @see EPartOfSpeech
 * @see LexicalEntry#getLemma()
 */
public Iterator<LexicalEntry> getLexicalEntryIterator(Lexicon lexicon)
{
  return getLexicalEntryIterator(null, lexicon);
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.lmf.api-asl

/**
 * Fetches the one UBY-LMF {@link LexicalResource} instance named "Uby" from the database
 * accessed by this {@link Uby} instance.
 *
 * This should work if the database has been created correctly and is the recommended way to
 * obtain the UBY-LMF lexical resource.
 *
 * @return a lexical resource named "Uby", contained in the accessed database, or null if the
 *         database does not contain the lexical resource with the name "Uby"
 */
public LexicalResource getLexicalResource()
{
  return this.getLexicalResource("Uby");
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

  wordnet = uby.getLexiconByName("WordNet");
} else if (tokens.get(0).getCAS().getDocumentLanguage().equals("de")) {
  wordnet = uby.getLexiconByName("GermaNet");
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);						
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.testing-asl

  private Uby createDB() throws DocumentException, IllegalArgumentException, FileNotFoundException {
    String uby_user = "root";
    String uby_pass = "pass";

    DBConfig dbConfig = 
//            new DBConfig("not_important","org.h2.Driver","h2",uby_user,uby_pass,true);
      new DBConfig("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1","org.h2.Driver",UBYH2Dialect.class.getName(),uby_user,uby_pass,true);
    
      LMFDBUtils.createTables(dbConfig);
      
      XMLToDBTransformer trans = new XMLToDBTransformer(dbConfig);
      
      trans.transform(new File("src/main/resources/UbyTestLexicon.xml"),"UbyTest");
      
      Uby uby = new Uby(dbConfig);	

    return uby;
  }

origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.lmf.api-asl

/**
 * Setting the configuration for the Uby database
 *
 * @param dbconfig
 *            Database configuration of the Uby database
 * @deprecated marked for deletion
 */
@Deprecated
public void setDbConfig(DBConfig dbconfig) throws FileNotFoundException{
  this.dbConfig=dbconfig;
  cfg = HibernateConnect.getConfiguration(dbConfig);
  sessionFactory = cfg.buildSessionFactory();
  openSession();
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

  wordnet = uby.getLexiconByName("WordNet");
} else if (language.equals("en")) {
  wordnet = uby.getLexiconByName("WordNet");
} else if (token.getCAS().getDocumentLanguage().equals("de")) {
  wordnet = uby.getLexiconByName("GermaNet");
} else if (language.equals("de")) {
  wordnet = uby.getLexiconByName("GermaNet");
  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);						
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

return new Uby(dbConfig);
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.lmf.api-asl

/**
 * Constructor for a {@link Uby} instance used for searching of different elements in a database
 * containing UBY-LMF {@link LexicalResource}.
 *
 * The connection to the database is specified using a {@link DBConfig} instance.
 *
 * @param dbConfig
 *            configuration of the database containing UBY-LMF lexical resource.
 * @throws UbyInvalidArgumentException
 *             if the specified dbConfig is null
 */
public Uby(DBConfig dbConfig) throws IllegalArgumentException
{
  if(dbConfig == null) {
    throw new IllegalArgumentException("database configuration is null");
  }
  this.dbConfig = dbConfig;
  cfg = HibernateConnect.getConfiguration(dbConfig);
  ServiceRegistryBuilder serviceRegistryBuilder = new ServiceRegistryBuilder()
      .applySettings(cfg.getProperties());
  sessionFactory = cfg.buildSessionFactory(serviceRegistryBuilder.buildServiceRegistry());
  openSession();
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

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;
}
origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

    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,
de.tudarmstadt.ukp.lmf.apiUby

Javadoc

Uby class represents the main entrance point to the UBY API. It holds methods for searching of different UBY-LMF elements in a database containing a LexicalResource.

Methods of this class return fully initialized UBY-LMF class instances. For performance reasons, you also may want to use UbyQuickAPI.

Most used methods

  • <init>
    Constructor for a Uby instance used for searching of different elements in a database containing UBY
  • getLexicalEntries
    Fetches a List of LexicalEntry instances which written representation is the specified word. Optiona
  • getLexicalEntryIterator
    Returns an Iterator over LexicalEntry instances which written representation is the specified word.
  • getLexicalResource
    Fetches a LexicalResource from the UBY-Database by its name.
  • getLexiconByName
    Fetches a Lexicon with the specified name from the database accessed by this Uby instance.
  • openSession
    Opens hibernate database session

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
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