Codota Logo
DocumentMetaData.getDocumentUri
Code IndexAdd Codota to your IDE (free)

How to use
getDocumentUri
method
in
de.tudarmstadt.ukp.teaching.uima.lesson1.type.DocumentMetaData

Best Java code snippets using de.tudarmstadt.ukp.teaching.uima.lesson1.type.DocumentMetaData.getDocumentUri (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: de.tudarmstadt.ukp.teaching.uima/de.tudarmstadt.ukp.teaching.uima.lesson2

@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException
{
  DocumentMetaData meta = iterate(aJCas, DocumentMetaData.class).iterator().next();
  // make a new, empty document
  Document doc = new Document();
  // Add the document metadata. Use fields that are indexed (i.e. searchable), but don't
  // tokenize the field into words.
  doc.add(new Field("documentUri", meta.getDocumentUri(), Store.YES, Index.NOT_ANALYZED));
  doc.add(new Field("documentBaseUri", meta.getDocumentBaseUri(), Store.YES, Index.NOT_ANALYZED));
  doc.add(new Field("language", aJCas.getDocumentLanguage(), Store.YES, Index.NOT_ANALYZED));
  // Add all tokens to the index without any further processing.
  doc.add(new Field("token", AnnotationStream.create(iterate(aJCas, Token.class)),
      TermVector.YES));
  // Optionally store the document text. It can be retrieved but not searched.
  if (storeText) {
    doc.add(new Field("text", aJCas.getDocumentText(), Store.YES, Index.NO));
  }
  try {
    writer.addDocument(doc);
  }
  catch (IOException e) {
    throw new AnalysisEngineProcessException(e);
  }
}
origin: de.tudarmstadt.ukp.teaching.uima/de.tudarmstadt.ukp.teaching.uima.lesson1

  @Override
  public void process(JCas aJCas) throws AnalysisEngineProcessException {
    DocumentMetaData meta = iterate(aJCas, DocumentMetaData.class).iterator().next();
    System.out.println("=== METADATA ========================================");
    System.out.println("URI     : "+meta.getDocumentUri());
    System.out.println("Language: "+aJCas.getDocumentLanguage());
    System.out.println("=== TEXT ============================================");
    System.out.println(aJCas.getDocumentText());
    System.out.println("=== ANNOTATIONS =====================================");
    for (Annotation a : iterate(aJCas, Annotation.class)) {
      System.out.println(a.getType().getName() + "(" + a.getBegin() + ","
          + a.getEnd() + ") [" + a.getCoveredText() + "]");
    }
  }
}
origin: de.tudarmstadt.ukp.teaching.uima/de.tudarmstadt.ukp.teaching.uima.lesson1

  @Test
  public void test() throws Exception
  {
    CollectionReader reader = CollectionReaderFactory.createCollectionReader(
        TextFileReader.class,
        createTypeSystemDescription(),
        TextFileReader.PARAM_PATH, "src/test/resources/textfiles",
        TextFileReader.PARAM_LANGUAGE, "Latin");

    int found = 0;
    CAS cas = CasCreationUtils.createCas(reader.getProcessingResourceMetaData());
    while (reader.hasNext()) {
      reader.getNext(cas);
      DocumentMetaData meta = iterate(cas.getJCas(), DocumentMetaData.class).iterator().next();
      for (Entry<String, String> entry : testFileContent.entrySet()) {
        if (meta.getDocumentUri().endsWith(entry.getKey())) {
          assertEquals(entry.getValue(), cas.getDocumentText());
          found++;
        }
      }
      cas.reset();
    }
    assertEquals(testFileContent.size(), found);
  }
}
de.tudarmstadt.ukp.teaching.uima.lesson1.typeDocumentMetaDatagetDocumentUri

Javadoc

getter for documentUri - gets

Popular methods of DocumentMetaData

  • <init>
  • addToIndexes
  • getDocumentBaseUri
    getter for documentBaseUri - gets
  • readObject
    Write your own initialization here
  • setBegin
  • setDocumentBaseUri
    setter for documentBaseUri - sets
  • setDocumentUri
    setter for documentUri - sets
  • setEnd

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
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